From 5e6edd7e7beadaf7e0a345f16a700d8824980c97 Mon Sep 17 00:00:00 2001 From: Stefan Kost Date: Wed, 22 Jul 2009 00:33:22 +0300 Subject: mpegdemux: don't add a base_time==-1 to segment positions Fixes assertion about newsegment with start=-1. --- gst/mpegdemux/gstmpegdemux.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'gst/mpegdemux') diff --git a/gst/mpegdemux/gstmpegdemux.c b/gst/mpegdemux/gstmpegdemux.c index dbf1567a..75d5960f 100644 --- a/gst/mpegdemux/gstmpegdemux.c +++ b/gst/mpegdemux/gstmpegdemux.c @@ -845,6 +845,7 @@ gst_flups_demux_close_segment (GstFluPSDemux * demux) { gint id; GstEvent *event = NULL; + guint64 base_time; #if POST_10_10 GST_INFO_OBJECT (demux, "closing running segment %" GST_SEGMENT_FORMAT, @@ -855,14 +856,17 @@ gst_flups_demux_close_segment (GstFluPSDemux * demux) * last_seg_start != clock_time_none, as that indicates a sparse-stream * event was sent there */ + if ((base_time = demux->base_time) == (guint64) - 1) + base_time = 0; + + /* Close the current segment for a linear playback */ if (demux->src_segment.rate >= 0) { /* for forward playback, we played from start to last_stop */ event = gst_event_new_new_segment (TRUE, demux->src_segment.rate, demux->src_segment.format, - demux->src_segment.start + demux->base_time, - demux->src_segment.last_stop + demux->base_time, - demux->src_segment.time); + demux->src_segment.start + base_time, + demux->src_segment.last_stop + base_time, demux->src_segment.time); } else { gint64 stop; @@ -872,8 +876,8 @@ gst_flups_demux_close_segment (GstFluPSDemux * demux) /* for reverse playback, we played from stop to last_stop. */ event = gst_event_new_new_segment (TRUE, demux->src_segment.rate, demux->src_segment.format, - demux->src_segment.last_stop + demux->base_time, - stop + demux->base_time, demux->src_segment.last_stop); + demux->src_segment.last_stop + base_time, + stop + base_time, demux->src_segment.last_stop); } if (event) { -- cgit v1.2.1