This adds auto to vidscale script option, which lets the scale be inherited from OSD --osd-scale-by-window option.
Unified · Split
| @@ -0,0 +1 @@ | ||
| 1 | +change `vidscale` script option type to string for osc.lua | |
| @@ -250,8 +250,10 @@ Configurable Options · 249 unmodified lines | ||
| 250 | 250 | ``vidscale`` |
| 251 | 251 | Default: yes |
| 252 | 252 | |
| 253 | − Scale the OSC with the video | |
| 254 | − ``no`` tries to keep the OSC size constant as much as the window size allows | |
| 253 | + Scale the OSC with the video. | |
| 254 | + ``no`` tries to keep the OSC size constant as much as the window size allows. | |
| 255 | + ``auto`` scales the OSC with the OSD, which is scaled with the window or kept at a | |
| 256 | + constant size, depending on the ``--osd-scale-by-window`` option. | |
| 255 | 257 | |
| 256 | 258 | ``valign`` |
| 257 | 259 | Default: 0.8 |
| @@ -14,7 +14,7 @@ local user_opts = { · 13 unmodified lines | ||
| 14 | 14 | idlescreen = true, -- show mpv logo on idle |
| 15 | 15 | scalewindowed = 1, -- scaling of the controller when windowed |
| 16 | 16 | scalefullscreen = 1, -- scaling of the controller when fullscreen |
| 17 | − vidscale = true, -- scale the controller with the video? | |
| 17 | + vidscale = "yes", -- scale the controller with the video? | |
| 18 | 18 | valign = 0.8, -- vertical alignment, -1 (top) to 1 (bottom) |
| 19 | 19 | halign = 0, -- horizontal alignment, -1 (left) to 1 (right) |
| 20 | 20 | barmargin = 0, -- vertical margin of top/bottombar |
| @@ -1785,7 +1785,14 @@ function osc_init() · 1764 unmodified lines | ||
| 1785 | 1785 | scale = user_opts.scalewindowed |
| 1786 | 1786 | end |
| 1787 | 1787 | |
| 1788 | − if user_opts.vidscale then | |
| 1788 | + local scale_with_video | |
| 1789 | + if user_opts.vidscale == "auto" then | |
| 1790 | + scale_with_video = mp.get_property_native("osd-scale-by-window") | |
| 1791 | + else | |
| 1792 | + scale_with_video = user_opts.vidscale == "yes" | |
| 1793 | + end | |
| 1794 | + | |
| 1795 | + if scale_with_video then | |
| 1789 | 1796 | osc_param.unscaled_y = baseResY |
| 1790 | 1797 | else |
| 1791 | 1798 | osc_param.unscaled_y = display_h |