Commit 849622b8 authored by Simon Morlat's avatar Simon Morlat
Browse files

Fix bug in android MediaCodec integration causing corrupted decoded images...

Fix bug in android MediaCodec integration causing corrupted decoded images when the MediaCodec runs out of buffers.
parent 6f34d2f4
......@@ -58,15 +58,24 @@ void H26xDecoderFilter::process() {
if (unpacking_ret.frameCorrupted) {
ms_warning("H26xDecoder: corrupted frame");
requestPli = true;
if (_freezeOnError) {
ms_queue_flush(&frame);
if (_freezeOnError){
/*in freeze on error mode we must not supply a corrupted frame to the decoder. */
_codec->waitForKeyFrame();
ms_queue_flush(&frame);
continue;
}
}
/*
* Feed the decoder implementation with the full frame.
* In case of feeding error (such too many buffers queued), we will request a PLI.
*/
if (!_codec->feed(&frame, ms_get_cur_time_ms())) requestPli = true;
if (requestPli && _freezeOnError) {
/* In freeze on error mode, regardless of the decoding failure cause, we must restart with a key-frame. */
_codec->waitForKeyFrame();
}
ms_queue_flush(&frame);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment