From 68bd65c22547669c902c6840481ee09dc474b05e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Dzi=C4=99giel?= Date: Wed, 24 Feb 2021 11:41:40 +0100 Subject: [PATCH] API: snap at nearest keyframe when doing fast seek GStreamer needs to perform a seek when changing playback rate. Snapping at next keyframe causes viewer to lose few seconds of video when changing playback speed (and ugly fast forward effect when dragging speed slider). Prevent all those issues by seeking to the nearest keyframe instead. --- lib/gst/clapper/gstclapper.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/gst/clapper/gstclapper.c b/lib/gst/clapper/gstclapper.c index c026bd75..ef459552 100644 --- a/lib/gst/clapper/gstclapper.c +++ b/lib/gst/clapper/gstclapper.c @@ -3222,7 +3222,7 @@ gst_clapper_seek_internal_locked (GstClapper * self) flags |= GST_SEEK_FLAG_ACCURATE; break; case GST_CLAPPER_SEEK_MODE_FAST: - flags |= GST_SEEK_FLAG_KEY_UNIT | GST_SEEK_FLAG_SNAP_AFTER; + flags |= GST_SEEK_FLAG_KEY_UNIT | GST_SEEK_FLAG_SNAP_NEAREST; break; default: break;