From 215c9eb71aa6afde477e0300c79102a2f4da2e0b Mon Sep 17 00:00:00 2001 From: Edward Hervey Date: Tue, 8 Mar 2016 11:41:49 +0100 Subject: [PATCH] tsdemux: Don't reset/recalculate segments with accurate seeks When dealing with accurate seeks, we must send out a segment which is exactly what is requested. https://bugzilla.gnome.org/show_bug.cgi?id=763262 --- gst/mpegtsdemux/tsdemux.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/gst/mpegtsdemux/tsdemux.c b/gst/mpegtsdemux/tsdemux.c index b54a7d3711..8eaf9a798e 100644 --- a/gst/mpegtsdemux/tsdemux.c +++ b/gst/mpegtsdemux/tsdemux.c @@ -861,8 +861,8 @@ gst_ts_demux_do_seek (MpegTSBase * base, GstEvent * event) gst_segment_do_seek (&demux->segment, rate, format, flags, start_type, start, stop_type, stop, NULL); - if (!(flags & GST_SEEK_FLAG_ACCURATE)) - demux->reset_segment = TRUE; + /* Reset segment if we're not doing an accurate seek */ + demux->reset_segment = (!(flags & GST_SEEK_FLAG_ACCURATE)); if (demux->segment_event) { gst_event_unref (demux->segment_event); @@ -1618,7 +1618,8 @@ gst_ts_demux_stream_added (MpegTSBase * base, MpegTSBaseStream * bstream, stream->active = FALSE; stream->need_newsegment = TRUE; - demux->reset_segment = TRUE; + /* Reset segment if we're not doing an accurate seek */ + demux->reset_segment = (!(demux->segment.flags & GST_SEEK_FLAG_ACCURATE)); stream->needs_keyframe = FALSE; stream->discont = TRUE; stream->pts = GST_CLOCK_TIME_NONE;