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.
This commit is contained in:
Guido Cella 2024-05-30 05:29:47 +02:00 committed by Kacper Michajłow
parent 4059d1832b
commit 8939bfc3ef
1 changed files with 5 additions and 1 deletions

View File

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