matroskademux: Make sure we don't send invalid newsegments
authorEdward Hervey <bilboed@bilboed.com>
Tue, 2 Mar 2010 17:29:41 +0000 (18:29 +0100)
committerEdward Hervey <bilboed@bilboed.com>
Tue, 2 Mar 2010 20:20:45 +0000 (21:20 +0100)
Fixes #611501

gst/matroska/matroska-demux.c

index b9227a8..85ce5fe 100644 (file)
@@ -3536,6 +3536,8 @@ gst_matroska_demux_sync_streams (GstMatroskaDemux * demux)
       gint64 new_start;
 
       new_start = demux->segment.last_stop - (GST_SECOND / 2);
+      if (GST_CLOCK_TIME_IS_VALID (demux->segment.stop))
+        new_start = MIN (new_start, demux->segment.stop);
       GST_DEBUG_OBJECT (demux,
           "Synchronizing stream %d with others by advancing time " "from %"
           GST_TIME_FORMAT " to %" GST_TIME_FORMAT, stream_nr,