diff options
author | Thiago Santos <thiagoss@osg.samsung.com> | 2016-01-06 16:51:08 -0300 |
---|---|---|
committer | Tim-Philipp Müller <tim@centricular.com> | 2016-04-06 13:47:38 +0100 |
commit | 41cc29f0f8753347e059bf13981f766c4b22b759 (patch) | |
tree | 34e6d37a07621321aee3a46d9e85312361172c76 | |
parent | b106da299c0b056ebde28bebce2d61ce6fd2df2e (diff) | |
download | gstreamer-plugins-bad-41cc29f0f8753347e059bf13981f766c4b22b759.tar.gz |
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.
-rw-r--r-- | gst-libs/gst/adaptivedemux/gstadaptivedemux.c | 6 |
1 files 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 = |