summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWim Taymans <wim.taymans@collabora.co.uk>2009-07-01 11:23:59 +0200
committerWim Taymans <wim.taymans@collabora.co.uk>2009-07-01 11:23:59 +0200
commitfe10ecd097c82e257af2408913c25dddb8514022 (patch)
treea16bd41aa8658cf39de71f37d283ee1ccf3aea06
parent31a9d9330bfce39f2757fda8671578bf188c6d09 (diff)
ffdec: don't wait for keyframe after discont
After a DISCONT, mark the next frame with DISCONT but don't wait for a new keyframe. This greatly improves performance on lossy networks or currupted frames as the decoder can usually continue and conceil errors up to the next keyframe.
-rw-r--r--ext/ffmpeg/gstffmpegdec.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/ext/ffmpeg/gstffmpegdec.c b/ext/ffmpeg/gstffmpegdec.c
index a92edc2..2498b1f 100644
--- a/ext/ffmpeg/gstffmpegdec.c
+++ b/ext/ffmpeg/gstffmpegdec.c
@@ -2316,7 +2316,6 @@ gst_ffmpegdec_chain (GstPad * pad, GstBuffer * inbuf)
gst_ffmpegdec_drain (ffmpegdec);
gst_ffmpegdec_flush_pcache (ffmpegdec);
avcodec_flush_buffers (ffmpegdec->context);
- ffmpegdec->waiting_for_key = TRUE;
ffmpegdec->discont = TRUE;
ffmpegdec->last_out = GST_CLOCK_TIME_NONE;
ffmpegdec->next_ts = GST_CLOCK_TIME_NONE;
@@ -2333,6 +2332,7 @@ gst_ffmpegdec_chain (GstPad * pad, GstBuffer * inbuf)
/* do early keyframe check pretty bad to rely on the keyframe flag in the
* source for this as it might not even be parsed (UDP/file/..). */
if (G_UNLIKELY (ffmpegdec->waiting_for_key)) {
+ GST_DEBUG_OBJECT (ffmpegdec, "waiting for keyframe");
if (GST_BUFFER_FLAG_IS_SET (inbuf, GST_BUFFER_FLAG_DELTA_UNIT) &&
oclass->in_plugin->type != CODEC_TYPE_AUDIO)
goto skip_keyframe;