From 8939bfc3ef0f9f7e87d5c4fe0bdd8cacee8f85ee Mon Sep 17 00:00:00 2001 From: Guido Cella Date: Thu, 30 May 2024 05:29:47 +0200 Subject: [PATCH] select.lua: seek to the currect subtitle line when paused without video Add an offset to sub seek correctly like in b35e34ae2f. The extra 0.01 offset apparently isn't necessary in this case. --- player/lua/select.lua | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/player/lua/select.lua b/player/lua/select.lua index 40042e1f96..dada2a06a9 100644 --- a/player/lua/select.lua +++ b/player/lua/select.lua @@ -239,7 +239,11 @@ mp.add_forced_key_binding(nil, "select-subtitle-line", function () items = sub_lines, default_item = default_item, submit = function (index) - mp.commandv("seek", sub_times[index], "absolute") + -- Add an offset to seek to the correct line while paused without a + -- video track. + local offset = mp.get_property_native("current-tracks/video/image") == false + and 0 or .09 + mp.commandv("seek", sub_times[index] + offset, "absolute") end, }) end)