diff options
author | Thiago Santos <thiagoss@osg.samsung.com> | 2016-01-05 09:01:10 -0300 |
---|---|---|
committer | Tim-Philipp Müller <tim@centricular.com> | 2016-04-06 13:45:36 +0100 |
commit | 19a4a9f9b0eb1bd67bf2e4fff5dedf2393490947 (patch) | |
tree | df22b738c50d53aa8968ef3cf83a325b8397e4fb | |
parent | 86c622531d746543117ed82e1982bab2a750736e (diff) | |
download | gstreamer-plugins-bad-19a4a9f9b0eb1bd67bf2e4fff5dedf2393490947.tar.gz |
adaptivedemux: correctly track segment.position in reverse playback
For reverse, set position to segment.stop when starting and also
don't set the position to fragment end timestamp when it finishes,
just leave it at the fragment start.
-rw-r--r-- | gst-libs/gst/adaptivedemux/gstadaptivedemux.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/gst-libs/gst/adaptivedemux/gstadaptivedemux.c b/gst-libs/gst/adaptivedemux/gstadaptivedemux.c index 15d75e580..32b21f0b4 100644 --- a/gst-libs/gst/adaptivedemux/gstadaptivedemux.c +++ b/gst-libs/gst/adaptivedemux/gstadaptivedemux.c @@ -1137,7 +1137,10 @@ 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; - stream->segment.position = stream->segment.start; + if (demux->segment.rate > 1) + stream->segment.position = stream->segment.start; + else + stream->segment.position = stream->segment.stop; seg_evt = gst_event_new_segment (&stream->segment); gst_event_set_seqnum (seg_evt, demux->priv->segment_seqnum); gst_event_replace (&stream->pending_segment, seg_evt); @@ -2579,7 +2582,8 @@ gst_adaptive_demux_stream_advance_fragment_unlocked (GstAdaptiveDemux * demux, GST_TYPE_CLOCK_TIME, stream->download_total_time * GST_USECOND, NULL))); - if (GST_CLOCK_TIME_IS_VALID (duration)) { + /* Don't update to the end of the segment if in reverse playback */ + if (GST_CLOCK_TIME_IS_VALID (duration) && demux->segment.rate > 1) { GstClockTime offset = gst_adaptive_demux_stream_get_presentation_offset (demux, stream); GstClockTime period_start = |