From: <rb...@fr...> - 2005-04-25 18:16:55
|
CVS Root: /cvs/gstreamer Module: gst-ffmpeg Changes by: rbultje Date: Tue Apr 26 2005 04:16:32 EST Log message: * ext/ffmpeg/gstffmpegdec.c: (gst_ffmpegdec_handle_event): Use CODEC_CAP_DELAY and remove max-10-delayed-frames hack. Modified files: . : ChangeLog ext/ffmpeg : gstffmpegdec.c Links: http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-ffmpeg/ChangeLog.diff?r1=1.151&r2=1.152 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-ffmpeg/ext/ffmpeg/gstffmpegdec.c.diff?r1=1.99&r2=1.100 ====Begin Diffs==== Index: ChangeLog =================================================================== RCS file: /cvs/gstreamer/gst-ffmpeg/ChangeLog,v retrieving revision 1.151 retrieving revision 1.152 diff -u -d -r1.151 -r1.152 --- ChangeLog 23 Apr 2005 16:07:34 -0000 1.151 +++ ChangeLog 25 Apr 2005 18:16:20 -0000 1.152 @@ -1,3 +1,8 @@ +2005-04-25 Ronald S. Bultje <rb...@ro...> + + * ext/ffmpeg/gstffmpegdec.c: (gst_ffmpegdec_handle_event): + Use CODEC_CAP_DELAY and remove max-10-delayed-frames hack. 2005-04-23 Luca Ognibene <lu...@ti...> Reviewed by: Ronald S. Bultje <rb...@ro...> Index: gstffmpegdec.c RCS file: /cvs/gstreamer/gst-ffmpeg/ext/ffmpeg/gstffmpegdec.c,v retrieving revision 1.99 retrieving revision 1.100 diff -u -d -r1.99 -r1.100 --- gstffmpegdec.c 21 Apr 2005 19:01:36 -0000 1.99 +++ gstffmpegdec.c 25 Apr 2005 18:16:20 -0000 1.100 @@ -778,22 +778,24 @@ 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: { - 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); + case GST_EVENT_EOS: + if (oclass->in_plugin->capabilities & CODEC_CAP_DELAY) { + gint have_data, len, try = 0; + 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; - } case GST_EVENT_FLUSH: if (ffmpegdec->opened) { avcodec_flush_buffers (ffmpegdec->context); |