History

stats.lua: handle osd-scale-by-window runtime update

Allows the scale mode to be changed at runtime if vidscale is set to auto.

nanahi committed 2 years ago

Commit de371a51 parent 85b3a6e1 file · +12 −2Browse files

Unified · Split

player/lua/stats.lua+12−2
@@ -1353,7 +1353,7 @@ local function print_page(page, after_scroll) · 1352 unmodified lines
1353 end1353 end
1354end1354end
1355 1355
1356local function update_scale(_, value)1356local function update_scale(value)
1357 local scale_with_video1357 local scale_with_video
1358 if o.vidscale == "auto" then1358 if o.vidscale == "auto" then
1359 scale_with_video = mp.get_property_native("osd-scale-by-window")1359 scale_with_video = mp.get_property_native("osd-scale-by-window")
@@ -1376,6 +1376,15 @@ local function update_scale(_, value) · 16 unmodified lines
1376 end1376 end
1377end1377end
1378 1378
1379local function handle_osd_height_update(_, value)
1380 update_scale(value)
1381end
1382
1383local function handle_osd_scale_by_window_update()
1384 local value = mp.get_property_native("osd-height")
1385 update_scale(value)
1386end
1387
1379local function clear_screen()1388local function clear_screen()
1380 if o.persistent_overlay then mp.set_osd_ass(0, 0, "") else mp.osd_message("", 0) end1389 if o.persistent_overlay then mp.set_osd_ass(0, 0, "") else mp.osd_message("", 0) end
1381end1390end
@@ -1604,4 +1613,5 @@ if o.bindlist ~= "no" then · 222 unmodified lines
1604 end)1613 end)
1605end1614end
1606 1615
1607mp.observe_property('osd-height', 'native', update_scale)1616mp.observe_property('osd-height', 'native', handle_osd_height_update)
1617mp.observe_property('osd-scale-by-window', 'native', handle_osd_scale_by_window_update)

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