ext/ffmpeg/gstffmpegdec.c: Safety bet to not completely crush the system on EOS. Fixes the bad behaviour of #300200 (...

Original commit message from CVS:
* ext/ffmpeg/gstffmpegdec.c: (gst_ffmpegdec_handle_event):
Safety bet to not completely crush the system on EOS. Fixes the
bad behaviour of #300200 (doesn't fix the actual issue).
This commit is contained in:
Ronald S. Bultje 2005-04-14 10:50:15 +00:00
parent 395ebbdf4b
commit 15ffb2974a
2 changed files with 9 additions and 2 deletions

View file

@ -1,3 +1,9 @@
2005-04-14 Ronald S. Bultje <rbultje@ronald.bitfreak.net>
* ext/ffmpeg/gstffmpegdec.c: (gst_ffmpegdec_handle_event):
Safety bet to not completely crush the system on EOS. Fixes the
bad behaviour of #300200 (doesn't fix the actual issue).
2005-04-02 Ronald S. Bultje <rbultje@ronald.bitfreak.net>
* ext/ffmpeg/gstffmpegdec.c: (gst_ffmpegdec_open),

View file

@ -778,14 +778,15 @@ gst_ffmpegdec_handle_event (GstFFMpegDec * ffmpegdec, GstEvent * event)
switch (GST_EVENT_TYPE (event)) {
case GST_EVENT_EOS: {
gint have_data, len;
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 (1);
} while (try++ < 10);
goto forward;
}
case GST_EVENT_FLUSH: