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.
This commit is contained in:
Rafał Dzięgiel
2021-02-24 11:41:40 +01:00
parent 199a8f1931
commit 68bd65c225

View File

@@ -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;