diff options
-rw-r--r-- | ext/dash/gstdashdemux.c | 4 | ||||
-rw-r--r-- | ext/dash/gstmpdparser.c | 5 |
2 files changed, 9 insertions, 0 deletions
diff --git a/ext/dash/gstdashdemux.c b/ext/dash/gstdashdemux.c index 461ec7fab..0af18c2bb 100644 --- a/ext/dash/gstdashdemux.c +++ b/ext/dash/gstdashdemux.c @@ -1290,6 +1290,10 @@ gst_dash_demux_stream_sidx_seek (GstDashDemuxStream * dashstream, /* FIXME in reverse mode, if we are exactly at a fragment start it makes more * sense to start from the end of the previous fragment */ + if (!forward && idx > 0 && entry->pts == ts) { + idx--; + entry = &sidx->entries[idx]; + } /* Now entry->pts <= ts < entry->pts + entry->duration, need to adjust for * snapping */ diff --git a/ext/dash/gstmpdparser.c b/ext/dash/gstmpdparser.c index a1d4cdace..944370191 100644 --- a/ext/dash/gstmpdparser.c +++ b/ext/dash/gstmpdparser.c @@ -4864,6 +4864,11 @@ gst_mpd_client_stream_seek (GstMpdClient * client, GstActiveStream * stream, ts = 0; index = ts / duration; + + /* At the end of a segment in reverse mode, start from the previous fragment */ + if (!forward && index > 0 && ts % duration == 0) + index--; + index_time = index * duration; if ((flags & GST_SEEK_FLAG_SNAP_NEAREST) == GST_SEEK_FLAG_SNAP_NEAREST) { |