diff options
author | Stefan Kost <ensonic@users.sf.net> | 2009-07-22 00:33:22 +0300 |
---|---|---|
committer | Stefan Kost <ensonic@users.sf.net> | 2009-07-22 00:33:22 +0300 |
commit | 5e6edd7e7beadaf7e0a345f16a700d8824980c97 (patch) | |
tree | b3c14b6845d62fb56d1ca5beb6fb773f12e71059 /gst | |
parent | 43657ef1f3aa85f7e5dbce57681181da4c049b96 (diff) | |
download | gst-plugins-bad-5e6edd7e7beadaf7e0a345f16a700d8824980c97.tar.gz gst-plugins-bad-5e6edd7e7beadaf7e0a345f16a700d8824980c97.tar.bz2 gst-plugins-bad-5e6edd7e7beadaf7e0a345f16a700d8824980c97.zip |
mpegdemux: don't add a base_time==-1 to segment positions
Fixes assertion about newsegment with start=-1.
Diffstat (limited to 'gst')
-rw-r--r-- | gst/mpegdemux/gstmpegdemux.c | 14 |
1 files changed, 9 insertions, 5 deletions
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) { |