Commit 1d951974 authored by IBM Thinklab's avatar IBM Thinklab Committed by Sebastian Dröge

avviddec: drain frames until libav doesn't have more data

We use have_data (that comes from libav), instead of only trying 10 times,
to know if there are more frames available. The old code was machine
dependant as different amount of frames could be decoded by different
type of (more powerful) machines, and 10 times was not always sufficient.

https://bugzilla.gnome.org/show_bug.cgi?id=736515
parent cfb576ef
......@@ -1438,7 +1438,7 @@ gst_ffmpegviddec_drain (GstFFMpegVidDec * ffmpegdec)
oclass = (GstFFMpegVidDecClass *) (G_OBJECT_GET_CLASS (ffmpegdec));
if (oclass->in_plugin->capabilities & CODEC_CAP_DELAY) {
gint have_data, len, try = 0;
gint have_data, len;
GST_LOG_OBJECT (ffmpegdec,
"codec has delay capabilities, calling until ffmpeg has drained everything");
......@@ -1448,9 +1448,7 @@ gst_ffmpegviddec_drain (GstFFMpegVidDec * ffmpegdec)
len = gst_ffmpegviddec_frame (ffmpegdec, NULL, 0, &have_data, NULL, &ret);
if (len < 0 || have_data == 0)
break;
} while (try++ < 10);
} while (len >= 0 && have_data == 1);
avcodec_flush_buffers (ffmpegdec->context);
}
}
......
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