Allows the scale mode to be changed at runtime if vidscale is set to auto.
Unified · Split
| @@ -1353,7 +1353,7 @@ local function print_page(page, after_scroll) · 1352 unmodified lines | ||
| 1353 | 1353 | end |
| 1354 | 1354 | end |
| 1355 | 1355 | |
| 1356 | −local function update_scale(_, value) | |
| 1356 | +local function update_scale(value) | |
| 1357 | 1357 | local scale_with_video |
| 1358 | 1358 | if o.vidscale == "auto" then |
| 1359 | 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 | 1376 | end |
| 1377 | 1377 | end |
| 1378 | 1378 | |
| 1379 | +local function handle_osd_height_update(_, value) | |
| 1380 | + update_scale(value) | |
| 1381 | +end | |
| 1382 | + | |
| 1383 | +local function handle_osd_scale_by_window_update() | |
| 1384 | + local value = mp.get_property_native("osd-height") | |
| 1385 | + update_scale(value) | |
| 1386 | +end | |
| 1387 | + | |
| 1379 | 1388 | local function clear_screen() |
| 1380 | 1389 | if o.persistent_overlay then mp.set_osd_ass(0, 0, "") else mp.osd_message("", 0) end |
| 1381 | 1390 | end |
| @@ -1604,4 +1613,5 @@ if o.bindlist ~= "no" then · 222 unmodified lines | ||
| 1604 | 1613 | end) |
| 1605 | 1614 | end |
| 1606 | 1615 | |
| 1607 | −mp.observe_property('osd-height', 'native', update_scale) | |
| 1616 | +mp.observe_property('osd-height', 'native', handle_osd_height_update) | |
| 1617 | +mp.observe_property('osd-scale-by-window', 'native', handle_osd_scale_by_window_update) | |