qtdemux: forward DISCONT from upstream to the output streams
authorGeorge Kiagiadakis <george.kiagiadakis@collabora.com>
Thu, 7 Aug 2014 14:12:38 +0000 (17:12 +0300)
committerSebastian Dröge <sebastian@centricular.com>
Mon, 11 Aug 2014 08:28:14 +0000 (10:28 +0200)
This makes sense in DASH reverse playback, where the upstream dashdemux
will download DASH segments in reverse order, but push their buffers
forward to qtdemux and mark each segment start as DISCONT. This needs
to be forwarded downstream to the parser/decoder, otherwise it won't work.

https://bugzilla.gnome.org/show_bug.cgi?id=734443

gst/isomp4/qtdemux.c

index 0096857..3f5565f 100644 (file)
@@ -4618,6 +4618,17 @@ gst_qtdemux_chain (GstPad * sinkpad, GstObject * parent, GstBuffer * inbuf)
   GstQTDemux *demux;
 
   demux = GST_QTDEMUX (parent);
+
+  if (GST_BUFFER_FLAG_IS_SET (inbuf, GST_BUFFER_FLAG_DISCONT)) {
+    gint i;
+
+    GST_DEBUG_OBJECT (demux, "Got DISCONT, marking all streams as DISCONT");
+
+    for (i = 0; i < demux->n_streams; i++) {
+      demux->streams[i]->discont = TRUE;
+    }
+  }
+
   gst_adapter_push (demux->adapter, inbuf);
 
   GST_DEBUG_OBJECT (demux,