From 58e3033747b0e96d7d4d120141707525587dbdd2 Mon Sep 17 00:00:00 2001 From: Edward Hervey Date: Fri, 14 Apr 2017 17:01:49 +0200 Subject: [PATCH] qtdemux: Reset adapter in more discontinuity cases In push mode we process as much as possible in the adapter. When we receive a DISCONT buffer which we can't match to an actual sample (based on the existing sample table) and there is still data remaining in the incoming adapter,there is one of two cases happening: 1) We are doing reverse playback, in which case we should flush out all pending data 2) We have leftover data from the previous incoming buffer... which we can't do anything about. For the second case, make sure we flush out the remaining data so that we can start parsing again from scratch. https://bugzilla.gnome.org/show_bug.cgi?id=781319 --- gst/isomp4/qtdemux.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/gst/isomp4/qtdemux.c b/gst/isomp4/qtdemux.c index 68933889de..3a271af670 100644 --- a/gst/isomp4/qtdemux.c +++ b/gst/isomp4/qtdemux.c @@ -6326,10 +6326,12 @@ gst_qtdemux_chain (GstPad * sinkpad, GstObject * parent, GstBuffer * inbuf) } } if (!is_gap_input) { + GST_DEBUG_OBJECT (demux, "Resetting, actual DISCONT"); /* Reset state if it's a real discont */ demux->neededbytes = 16; demux->state = QTDEMUX_STATE_INITIAL; demux->offset = GST_BUFFER_OFFSET (inbuf); + gst_adapter_clear (demux->adapter); } } /* Reverse fragmented playback, need to flush all we have before