ext/ffmpeg/gstffmpegdec.c: Use CODEC_CAP_DELAY and remove max-10-delayed-frames hack.

Original commit message from CVS:
* ext/ffmpeg/gstffmpegdec.c: (gst_ffmpegdec_handle_event):
Use CODEC_CAP_DELAY and remove max-10-delayed-frames hack.
This commit is contained in:
Ronald S. Bultje 2005-04-25 18:16:20 +00:00
parent 3d55f87758
commit b58fe00616
2 changed files with 18 additions and 11 deletions

View file

@ -1,3 +1,8 @@
2005-04-25 Ronald S. Bultje <rbultje@ronald.bitfreak.net>
* ext/ffmpeg/gstffmpegdec.c: (gst_ffmpegdec_handle_event):
Use CODEC_CAP_DELAY and remove max-10-delayed-frames hack.
2005-04-23 Luca Ognibene <luogni@tin.it>
Reviewed by: Ronald S. Bultje <rbultje@ronald.bitfreak.net>

View file

@ -778,22 +778,24 @@ gst_ffmpegdec_frame (GstFFMpegDec * ffmpegdec,
static void
gst_ffmpegdec_handle_event (GstFFMpegDec * ffmpegdec, GstEvent * event)
{
GstFFMpegDecClass *oclass =
(GstFFMpegDecClass *) (G_OBJECT_GET_CLASS (ffmpegdec));
GST_DEBUG_OBJECT (ffmpegdec,
"Handling event of type %d", GST_EVENT_TYPE (event));
switch (GST_EVENT_TYPE (event)) {
case GST_EVENT_EOS: {
case GST_EVENT_EOS:
if (oclass->in_plugin->capabilities & CODEC_CAP_DELAY) {
gint have_data, len, try = 0;
/* max. 10 times, for safety (see e.g. #300200) */
do {
len = gst_ffmpegdec_frame (ffmpegdec, NULL, 0, &have_data,
&ffmpegdec->next_ts);
if (len < 0 || have_data == 0)
break;
} while (try++ < 10);
goto forward;
}
goto forward;
case GST_EVENT_FLUSH:
if (ffmpegdec->opened) {
avcodec_flush_buffers (ffmpegdec->context);