summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChrisK2 <spam@kalania.de>2013-10-26 03:50:11 +0200
committerwm4 <wm4@nowhere>2013-11-02 19:03:03 +0100
commit4cd36b999faccd28a0b8cebd7fab7b8c07b07c8b (patch)
tree536eaeeca03d5dc7883ff9650eef7abc1f99cffc
parent1b3155cf51e2cf310d036194363d2fd6694685b8 (diff)
downloadmpv-4cd36b999faccd28a0b8cebd7fab7b8c07b07c8b.tar.bz2
mpv-4cd36b999faccd28a0b8cebd7fab7b8c07b07c8b.tar.xz
osc: make sure the OSC actually fits into the video
-rw-r--r--mpvcore/lua/osc.lua8
1 files changed, 7 insertions, 1 deletions
diff --git a/mpvcore/lua/osc.lua b/mpvcore/lua/osc.lua
index c724c7737c..f79a94b989 100644
--- a/mpvcore/lua/osc.lua
+++ b/mpvcore/lua/osc.lua
@@ -650,13 +650,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))