From 5d09bc04a29866b0c5459489265a7c277754c375 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Sebastian=20Dr=C3=B6ge?= Date: Wed, 15 Mar 2017 16:46:55 +0200 Subject: [PATCH] dashdemux: Add current fragment duration in reverse playback mode to the position We play from the end of the fragment to the beginning, not from the beginning backwards. --- ext/dash/gstdashdemux.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ext/dash/gstdashdemux.c b/ext/dash/gstdashdemux.c index 3c4cb6b..a50f834 100644 --- a/ext/dash/gstdashdemux.c +++ b/ext/dash/gstdashdemux.c @@ -1292,6 +1292,8 @@ gst_dash_demux_stream_update_fragment_info (GstAdaptiveDemuxStream * stream) dashstream->actual_position = fragment.timestamp + dashstream->current_sync_sample * dashstream->keyframe_average_distance; + if (stream->segment.rate < 0.0) + dashstream->actual_position += dashstream->keyframe_average_distance; dashstream->actual_position = MIN (dashstream->actual_position, fragment.timestamp + stream->fragment.duration); @@ -1332,6 +1334,7 @@ gst_dash_demux_stream_update_fragment_info (GstAdaptiveDemuxStream * stream) if (stream->demux->segment.rate < 0.0) { stream->fragment.range_end = stream->fragment.range_start + entry->size - 1; + dashstream->actual_position += entry->duration; } else { stream->fragment.range_end = fragment.range_end; } -- 2.7.4