qtdemux: do not update segment.stop is it is not a valid time
authorThiago Santos <thiagossantos@gmail.com>
Mon, 14 May 2018 04:59:49 +0000 (21:59 -0700)
committerThiago Santos <thiagossantos@gmail.com>
Fri, 25 May 2018 15:34:29 +0000 (08:34 -0700)
Otherwise it overflows and starts having a meaningful and wrong value.

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

gst/isomp4/qtdemux.c

index d34c865..3509f47 100644 (file)
@@ -4917,8 +4917,10 @@ gst_qtdemux_stream_update_segment (GstQTDemux * qtdemux, QtDemuxStream * stream,
   stream->segment.rate = rate;
   stream->segment.start = start + QTSTREAMTIME_TO_GSTTIME (stream,
       stream->cslg_shift) + min_ts;
-  stream->segment.stop = stop + QTSTREAMTIME_TO_GSTTIME (stream,
-      stream->cslg_shift) + min_ts;
+  if (GST_CLOCK_TIME_IS_VALID (stop)) {
+    stream->segment.stop = stop + QTSTREAMTIME_TO_GSTTIME (stream,
+        stream->cslg_shift) + min_ts;
+  }
   stream->segment.time = time + min_ts;
   stream->segment.position = stream->segment.start + min_ts;