From 4cd36b999faccd28a0b8cebd7fab7b8c07b07c8b Mon Sep 17 00:00:00 2001 From: ChrisK2 Date: Sat, 26 Oct 2013 03:50:11 +0200 Subject: osc: make sure the OSC actually fits into the video --- mpvcore/lua/osc.lua | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'mpvcore') 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)) -- cgit v1.2.3