gst-ffmpeg: ffdec: don't flush buffers on DISCONT
Wim Taymans
wtay at kemper.freedesktop.org
Fri Apr 20 07:24:23 PDT 2012
Module: gst-ffmpeg
Branch: master
Commit: 630790f50d04a4998a37a0e01304e9196f776476
URL: http://cgit.freedesktop.org/gstreamer/gst-ffmpeg/commit/?id=630790f50d04a4998a37a0e01304e9196f776476
Author: Wim Taymans <wim.taymans at collabora.co.uk>
Date: Fri Apr 20 16:16:25 2012 +0200
ffdec: don't flush buffers on DISCONT
Don't flush the buffers that ffmpeg has on DISCONT but instead let it recover.
This gives a much better image in the case of packet loss.
Fixes https://bugzilla.gnome.org/show_bug.cgi?id=635020
---
ext/ffmpeg/gstffmpegdec.c | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/ext/ffmpeg/gstffmpegdec.c b/ext/ffmpeg/gstffmpegdec.c
index 918abf8..719c538 100644
--- a/ext/ffmpeg/gstffmpegdec.c
+++ b/ext/ffmpeg/gstffmpegdec.c
@@ -2560,15 +2560,15 @@ gst_ffmpegdec_chain (GstPad * pad, GstBuffer * inbuf)
discont = GST_BUFFER_IS_DISCONT (inbuf);
/* The discont flags marks a buffer that is not continuous with the previous
- * buffer. This means we need to clear whatever data we currently have. We
- * currently also wait for a new keyframe, which might be suboptimal in the
- * case of a network error, better show the errors than to drop all data.. */
+ * buffer. This means we need to clear whatever data we currently have. We let
+ * ffmpeg continue with the data that it has. We currently drain the old
+ * frames that might be inside the decoder and we clear any partial data in
+ * the pcache, we might be able to remove the drain and flush too. */
if (G_UNLIKELY (discont)) {
GST_DEBUG_OBJECT (ffmpegdec, "received DISCONT");
/* drain what we have queued */
gst_ffmpegdec_drain (ffmpegdec);
gst_ffmpegdec_flush_pcache (ffmpegdec);
- avcodec_flush_buffers (ffmpegdec->context);
ffmpegdec->discont = TRUE;
gst_ffmpegdec_reset_ts (ffmpegdec);
}
More information about the gstreamer-commits
mailing list