1
0
mirror of https://github.com/mpv-player/mpv synced 2025-02-02 21:21:33 +00:00

osc: make sure the OSC actually fits into the video

This commit is contained in:
ChrisK2 2013-10-26 03:50:11 +02:00
parent ecc0705f83
commit 3a181bac1f

View File

@ -651,13 +651,19 @@ function osc_init()
end
if user_opts.vidscale == true then
if user_opts.vidscale then
osc_param.playresy = baseResY / scale
else
osc_param.playresy = display_h / scale
end
osc_param.playresx = osc_param.playresy * display_aspect
-- make sure the OSC actually fits into the video
if (osc_param.playresx < (osc_param.osc_w + (2 * osc_param.osc_p))) then
osc_param.playresy = (osc_param.osc_w + (2 * osc_param.osc_p)) / display_aspect
osc_param.playresx = osc_param.playresy * display_aspect
end
-- position of the controller according to video aspect and valignment
osc_param.posX = math.floor(get_align(user_opts.halign, osc_param.playresx, osc_param.osc_w, 0))
osc_param.posY = math.floor(get_align(user_opts.valign, osc_param.playresy, osc_param.osc_h, 0))