tsdemux: accumulate previous segment base time
authorVincent Penquerc'h <vincent.penquerch@collabora.co.uk>
Wed, 6 May 2015 14:16:37 +0000 (15:16 +0100)
committerVincent Penquerc'h <vincent.penquerch@collabora.co.uk>
Fri, 15 May 2015 13:49:04 +0000 (14:49 +0100)
gst/mpegtsdemux/tsdemux.c

index e8c13f6..4f05672 100644 (file)
@@ -1998,7 +1998,8 @@ calculate_and_push_newsegment (GstTSDemux * demux, TSDemuxStream * stream)
       demux->segment = base->segment;
     } else {
       /* Start from the first ts/pts */
-      GstClockTime base = demux->segment.position - demux->segment.start;
+      GstClockTime base =
+          demux->segment.base + demux->segment.position - demux->segment.start;
       gst_segment_init (&demux->segment, GST_FORMAT_TIME);
       demux->segment.start = firstts;
       demux->segment.stop = GST_CLOCK_TIME_NONE;