diff --git a/DOCS/interface-changes/osdscale.txt b/DOCS/interface-changes/osdscale.txt new file mode 100644 index 0000000000..edae2a6077 --- /dev/null +++ b/DOCS/interface-changes/osdscale.txt @@ -0,0 +1 @@ +change `vidscale` script option type to string for osc.lua diff --git a/DOCS/man/osc.rst b/DOCS/man/osc.rst index 0a9b54c5cf..58387cd9b0 100644 --- a/DOCS/man/osc.rst +++ b/DOCS/man/osc.rst @@ -250,8 +250,10 @@ Configurable Options ``vidscale`` Default: yes - Scale the OSC with the video - ``no`` tries to keep the OSC size constant as much as the window size allows + Scale the OSC with the video. + ``no`` tries to keep the OSC size constant as much as the window size allows. + ``auto`` scales the OSC with the OSD, which is scaled with the window or kept at a + constant size, depending on the ``--osd-scale-by-window`` option. ``valign`` Default: 0.8 diff --git a/player/lua/osc.lua b/player/lua/osc.lua index 6388c3e988..34ac370956 100644 --- a/player/lua/osc.lua +++ b/player/lua/osc.lua @@ -14,7 +14,7 @@ local user_opts = { idlescreen = true, -- show mpv logo on idle scalewindowed = 1, -- scaling of the controller when windowed scalefullscreen = 1, -- scaling of the controller when fullscreen - vidscale = true, -- scale the controller with the video? + vidscale = "yes", -- scale the controller with the video? valign = 0.8, -- vertical alignment, -1 (top) to 1 (bottom) halign = 0, -- horizontal alignment, -1 (left) to 1 (right) barmargin = 0, -- vertical margin of top/bottombar @@ -1785,7 +1785,14 @@ function osc_init() scale = user_opts.scalewindowed end - if user_opts.vidscale then + local scale_with_video + if user_opts.vidscale == "auto" then + scale_with_video = mp.get_property_native("osd-scale-by-window") + else + scale_with_video = user_opts.vidscale == "yes" + end + + if scale_with_video then osc_param.unscaled_y = baseResY else osc_param.unscaled_y = display_h