This will happen when the PMT changes, replacing streams with
new ones. In that case, we need to accumulate the running time
from the previous chain in the segment base.
https://bugzilla.gnome.org/show_bug.cgi?id=745102
stream->active = FALSE;
stream->need_newsegment = TRUE;
+ demux->reset_segment = TRUE;
stream->needs_keyframe = FALSE;
stream->discont = TRUE;
stream->pts = GST_CLOCK_TIME_NONE;
demux->segment = base->segment;
} else {
/* Start from the first ts/pts */
- GstClockTime base = demux->segment.base;
+ GstClockTime base = base = demux->segment.position - demux->segment.start;
gst_segment_init (&demux->segment, GST_FORMAT_TIME);
demux->segment.start = firstts;
demux->segment.stop = GST_CLOCK_TIME_NONE;