History

osc.lua: fix timetotal and timems settings

nanahi committed 2 years ago

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

Showing the changes to player/lua/osc.lua (1 of 1 file). Show all

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
222 state.osd:update()222 state.osd:update()
223end223end
224 224
225local 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
232end
233
225-- scale factor for translating between real and virtual ASS coordinates234-- scale factor for translating between real and virtual ASS coordinates
226local function get_virt_scale_factor()235local function get_virt_scale_factor()
227 local w, h = mp.get_osd_size()236 local w, h = mp.get_osd_size()
@@ -2984,6 +2993,7 @@ end · 2756 unmodified lines
2984opt.read_options(user_opts, "osc", function(changed)2993opt.read_options(user_opts, "osc", function(changed)
2985 validate_user_opts()2994 validate_user_opts()
2986 set_osc_styles()2995 set_osc_styles()
2996 set_time_styles(changed.timetotal, changed.timems)
2987 if changed.tick_delay or changed.tick_delay_follow_display_fps then2997 if changed.tick_delay or changed.tick_delay_follow_display_fps then
2988 set_tick_delay("display_fps", mp.get_property_number("display_fps"))2998 set_tick_delay("display_fps", mp.get_property_number("display_fps"))
2989 end2999 end
@@ -2995,6 +3005,7 @@ end) · 5 unmodified lines
2995 3005
2996validate_user_opts()3006validate_user_opts()
2997set_osc_styles()3007set_osc_styles()
3008set_time_styles(true, true)
2998set_tick_delay("display_fps", mp.get_property_number("display_fps"))3009set_tick_delay("display_fps", mp.get_property_number("display_fps"))
2999visibility_mode(user_opts.visibility, true)3010visibility_mode(user_opts.visibility, true)
3000update_duration_watch()3011update_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