[mediaplayer] don't panic if the audio render stalls
This CL changes the behavior of the media player when the audio renderer holds on to packets too long, which generally happens due to scheduling issues. Because the player has allocated a limited amount of space for transferring packets between itself and the renderer, that space can be exhausted if the renderer doesn't retire packets quickly enough. The fix is to drop packets instead of panicking. There are a few paths that had to be fixed to enable this. Sometimes the memory allocation failures occur in a callback from the audio decoder. Sometimes audio has to be interleaved after the decoder, and the allocation failure is detected there. Sometimes (when no decoder is needed) audio needs to be copied from system memory into vmo memory, and the failure happens prior to the copy. Two tests have been added to replicate these failure modes. Those tests produced panics before the fixes were introduced. TEST: new CQ tests Change-Id: I26582d19481c6716f6a4141e6717b68670ea44f1
Showing
- src/media/playback/mediaplayer/decode/software_decoder.cc 4 additions, 3 deletionssrc/media/playback/mediaplayer/decode/software_decoder.cc
- src/media/playback/mediaplayer/ffmpeg/ffmpeg_audio_decoder.cc 5 additions, 4 deletions...media/playback/mediaplayer/ffmpeg/ffmpeg_audio_decoder.cc
- src/media/playback/mediaplayer/graph/nodes/input.cc 5 additions, 1 deletionsrc/media/playback/mediaplayer/graph/nodes/input.cc
- src/media/playback/mediaplayer/graph/nodes/node.cc 4 additions, 1 deletionsrc/media/playback/mediaplayer/graph/nodes/node.cc
- src/media/playback/mediaplayer/test/fakes/fake_audio_renderer.cc 1 addition, 1 deletion...ia/playback/mediaplayer/test/fakes/fake_audio_renderer.cc
- src/media/playback/mediaplayer/test/fakes/fake_audio_renderer.h 7 additions, 0 deletions...dia/playback/mediaplayer/test/fakes/fake_audio_renderer.h
- src/media/playback/mediaplayer/test/mediaplayer_tests.cc 43 additions, 2 deletionssrc/media/playback/mediaplayer/test/mediaplayer_tests.cc
Loading
Please register or sign in to comment