From 41cc29f0f8753347e059bf13981f766c4b22b759 Mon Sep 17 00:00:00 2001 From: Thiago Santos Date: Wed, 6 Jan 2016 16:51:08 -0300 Subject: adaptivedemux: fix segment update on seeks Fixes typo on reverse rate check and also only update the position when the start/stop was actually changed. --- gst-libs/gst/adaptivedemux/gstadaptivedemux.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gst-libs/gst/adaptivedemux/gstadaptivedemux.c b/gst-libs/gst/adaptivedemux/gstadaptivedemux.c index a8f4ea94d..288ce18d5 100644 --- a/gst-libs/gst/adaptivedemux/gstadaptivedemux.c +++ b/gst-libs/gst/adaptivedemux/gstadaptivedemux.c @@ -1137,9 +1137,9 @@ gst_adaptive_demux_src_event (GstPad * pad, GstObject * parent, offset = gst_adaptive_demux_stream_get_presentation_offset (demux, stream); stream->segment.start += offset - period_start; - if (demux->segment.rate > 1) + if (demux->segment.rate > 0 && start_type != GST_SEEK_TYPE_NONE) stream->segment.position = stream->segment.start; - else + else if (demux->segment.rate < 0 && stop_type != GST_SEEK_TYPE_NONE) stream->segment.position = stream->segment.stop; seg_evt = gst_event_new_segment (&stream->segment); gst_event_set_seqnum (seg_evt, demux->priv->segment_seqnum); @@ -2583,7 +2583,7 @@ gst_adaptive_demux_stream_advance_fragment_unlocked (GstAdaptiveDemux * demux, stream->download_total_time * GST_USECOND, NULL))); /* Don't update to the end of the segment if in reverse playback */ - if (GST_CLOCK_TIME_IS_VALID (duration) && demux->segment.rate > 1) { + if (GST_CLOCK_TIME_IS_VALID (duration) && demux->segment.rate > 0) { GstClockTime offset = gst_adaptive_demux_stream_get_presentation_offset (demux, stream); GstClockTime period_start = -- cgit v1.2.1