History

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.

Guido Cella committed 2 years ago

Commit 8939bfc1 parent 4059d181 file · +5 −1Browse files

Unified · Split

player/lua/select.lua+5−1
@@ -239,7 +239,11 @@ mp.add_forced_key_binding(nil, "select-subtitle-line", function () · 238 unmodified lines
239 items = sub_lines,239 items = sub_lines,
240 default_item = default_item,240 default_item = default_item,
241 submit = function (index)241 submit = function (index)
242 mp.commandv("seek", sub_times[index], "absolute")242 -- Add an offset to seek to the correct line while paused without a
243 -- video track.
244 local offset = mp.get_property_native("current-tracks/video/image") == false
245 and 0 or .09
246 mp.commandv("seek", sub_times[index] + offset, "absolute")
243 end,247 end,
244 })248 })
245end)249end)

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t