History

osc.lua: fix timetotal and timems settings

nanahi committed 2 years ago

Commit 22103b81 parent d2bd77a1 file · +11 −0Browse files

Unified · Split

player/lua/osc.lua+11−0
@@ -222,6 +222,15 @@ local function set_osd(res_x, res_y, text, z) · 221 unmodified lines
222222 state.osd:update()
223223 end
224224
225+local function set_time_styles(timetotal_changed, timems_changed)
226+ if timetotal_changed then
227+ state.rightTC_trem = not user_opts.timetotal
228+ end
229+ if timems_changed then
230+ state.tc_ms = user_opts.timems
231+ end
232+end
233+
225234 -- scale factor for translating between real and virtual ASS coordinates
226235 local function get_virt_scale_factor()
227236 local w, h = mp.get_osd_size()
@@ -2984,6 +2993,7 @@ end · 2756 unmodified lines
29842993 opt.read_options(user_opts, "osc", function(changed)
29852994 validate_user_opts()
29862995 set_osc_styles()
2996+ set_time_styles(changed.timetotal, changed.timems)
29872997 if changed.tick_delay or changed.tick_delay_follow_display_fps then
29882998 set_tick_delay("display_fps", mp.get_property_number("display_fps"))
29892999 end
@@ -2995,6 +3005,7 @@ end) · 5 unmodified lines
29953005
29963006 validate_user_opts()
29973007 set_osc_styles()
3008+set_time_styles(true, true)
29983009 set_tick_delay("display_fps", mp.get_property_number("display_fps"))
29993010 visibility_mode(user_opts.visibility, true)
30003011 update_duration_watch()

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