qtdemux: Don't accumulate segment bases manually
authorSebastian Dröge <sebastian@centricular.com>
Tue, 7 Apr 2015 03:17:52 +0000 (20:17 -0700)
committerSebastian Dröge <sebastian@centricular.com>
Tue, 7 Apr 2015 03:17:52 +0000 (20:17 -0700)
gst_segment_do_seek() does that for us already, and doing it twice
will break non-flushing seeks in interesting ways. Leftover from 1.0
porting.

Also copy over segment offset and applied_rate, just in case.

gst/isomp4/qtdemux.c

index 4bcf91e..2279097 100644 (file)
@@ -3725,9 +3725,9 @@ gst_qtdemux_activate_segment (GstQTDemux * qtdemux, QtDemuxStream * stream,
 
   /* update the segment values used for clipping */
   /* accumulate previous segments */
-  if (GST_CLOCK_TIME_IS_VALID (stream->segment.stop))
-    stream->segment.base += (stream->segment.stop - stream->segment.start) /
-        ABS (stream->segment.rate);
+  stream->segment.offset = qtdemux->segment.offset;
+  stream->segment.base = qtdemux->segment.base;
+  stream->segment.applied_rate = qtdemux->segment.applied_rate;
   stream->segment.rate = rate;
   stream->segment.start = start;
   stream->segment.stop = stop;