adaptivedemux2: Fix non-accurate seeking

If no accurate positioning was required, default to snap to the previous segment
for improved responsiveness

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4922>
This commit is contained in:
Edward Hervey 2023-02-09 17:22:34 +01:00 committed by Edward Hervey
parent 38beda2b8e
commit 3cbfe5a481

View file

@ -2186,6 +2186,12 @@ gst_adaptive_demux_handle_seek_event (GstAdaptiveDemux * demux,
GST_ADAPTIVE_DEMUX_SEGMENT_LOCK (demux); GST_ADAPTIVE_DEMUX_SEGMENT_LOCK (demux);
if (!IS_SNAP_SEEK (flags) && !(flags & GST_SEEK_FLAG_ACCURATE)) {
/* If no accurate seeking was specified, we want to default to seeking to
* the previous segment for efficient/fast playback. */
flags |= GST_SEEK_FLAG_KEY_UNIT;
}
if (IS_SNAP_SEEK (flags)) { if (IS_SNAP_SEEK (flags)) {
GstAdaptiveDemux2Stream *default_stream = NULL; GstAdaptiveDemux2Stream *default_stream = NULL;
GstAdaptiveDemux2Stream *stream = NULL; GstAdaptiveDemux2Stream *stream = NULL;