ext/ffmpeg/gstffmpegdec.c: Only flush when the codec is opened.

Original commit message from CVS:
* ext/ffmpeg/gstffmpegdec.c: (gst_ffmpegdec_handle_event):
Only flush when the codec is opened.
This commit is contained in:
Ronald S. Bultje 2005-01-19 14:32:49 +00:00
parent 0403bd4305
commit 0ee46f8b0f
2 changed files with 11 additions and 2 deletions

View file

@ -1,3 +1,8 @@
2005-01-19 Ronald S. Bultje <rbultje@ronald.bitfreak.net>
* ext/ffmpeg/gstffmpegdec.c: (gst_ffmpegdec_handle_event):
Only flush when the codec is opened.
2005-01-19 Ronald S. Bultje <rbultje@ronald.bitfreak.net>
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_codecid_to_caps),

View file

@ -660,7 +660,9 @@ gst_ffmpegdec_handle_event (GstFFMpegDec * ffmpegdec, GstEvent * event)
{
switch (GST_EVENT_TYPE (event)) {
case GST_EVENT_FLUSH:
avcodec_flush_buffers (ffmpegdec->context);
if (ffmpegdec->opened) {
avcodec_flush_buffers (ffmpegdec->context);
}
goto forward;
case GST_EVENT_DISCONTINUOUS: {
gint64 value;
@ -685,7 +687,9 @@ gst_ffmpegdec_handle_event (GstFFMpegDec * ffmpegdec, GstEvent * event)
GST_WARNING_OBJECT (ffmpegdec,
"Received discont with no useful value...");
}
avcodec_flush_buffers (ffmpegdec->context);
if (ffmpegdec->opened) {
avcodec_flush_buffers (ffmpegdec->context);
}
/* fall-through */
}
default: