This adds auto to vidscale script option, which lets the scale be inherited from OSD --osd-scale-by-window option.
Showing the changes to player/lua/stats.lua (1 of 3 files). Show all
Unified · Split
| @@ -60,7 +60,7 @@ local o = { · 59 unmodified lines | |||
| 60 | shadow_y_offset = 0.0, | 60 | shadow_y_offset = 0.0, |
| 61 | shadow_color = "", | 61 | shadow_color = "", |
| 62 | alpha = "11", | 62 | alpha = "11", |
| 63 | vidscale = true, | 63 | vidscale = "yes", |
| 64 | 64 | ||
| 65 | -- Custom header for ASS tags to style the text output. | 65 | -- Custom header for ASS tags to style the text output. |
| 66 | -- Specifying this will ignore the text style values above and just | 66 | -- Specifying this will ignore the text style values above and just |
| @@ -1354,9 +1354,16 @@ local function print_page(page, after_scroll) · 1287 unmodified lines | |||
| 1354 | end | 1354 | end |
| 1355 | 1355 | ||
| 1356 | local function update_scale(_, value) | 1356 | local function update_scale(_, value) |
| 1357 | local scale_with_video | ||
| 1358 | if o.vidscale == "auto" then | ||
| 1359 | scale_with_video = mp.get_property_native("osd-scale-by-window") | ||
| 1360 | else | ||
| 1361 | scale_with_video = o.vidscale == "yes" | ||
| 1362 | end | ||
| 1363 | |||
| 1357 | -- Calculate scaled metrics. | 1364 | -- Calculate scaled metrics. |
| 1358 | local scale = 1 | 1365 | local scale = 1 |
| 1359 | if not o.vidscale and value > 0 then | 1366 | if not scale_with_video and value > 0 then |
| 1360 | scale = 720 / value | 1367 | scale = 720 / value |
| 1361 | end | 1368 | end |
| 1362 | font_size = o.font_size * scale | 1369 | font_size = o.font_size * scale |