qtdemux: send gap event for sparse streams in push mode
authorArnaud Vrac <avrac@freebox.fr>
Tue, 16 Jul 2013 19:59:37 +0000 (21:59 +0200)
committerSebastian Dröge <slomo@circular-chaos.org>
Thu, 18 Jul 2013 09:48:11 +0000 (11:48 +0200)
This allows to pre-roll at least if the next subtitle buffer
is far away.

gst/isomp4/qtdemux.c

index dfcdd1a..bd315bd 100644 (file)
@@ -4836,7 +4836,14 @@ gst_qtdemux_chain (GstPad * sinkpad, GstObject * parent, GstBuffer * inbuf)
           gst_qtdemux_push_pending_newsegment (demux);
           /* clear to send tags on all streams */
           for (i = 0; i < demux->n_streams; i++) {
-            gst_qtdemux_push_tags (demux, demux->streams[i]);
+            stream = demux->streams[i];
+            gst_qtdemux_push_tags (demux, stream);
+            if (stream->sparse) {
+              GST_INFO_OBJECT (demux, "Sending gap event on stream %d", i);
+              gst_pad_push_event (stream->pad,
+                  gst_event_new_gap (stream->segment.position,
+                      GST_CLOCK_TIME_NONE));
+            }
           }
         }