From 2e4f106ef87f3f42d88b8d76313967700437e271 Mon Sep 17 00:00:00 2001 From: wm4 Date: Mon, 29 Jun 2015 23:46:59 +0200 Subject: video: fix panscan in vertical case If the black bars appeared on the left/right borders, panscan=1 didn't make the video cover the whole screen. --- video/out/aspect.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'video') diff --git a/video/out/aspect.c b/video/out/aspect.c index 42c94918d7..2e1093c921 100644 --- a/video/out/aspect.c +++ b/video/out/aspect.c @@ -49,11 +49,16 @@ static void aspect_calc_panscan(struct mp_log *log, struct mp_vo_opts *opts, fwidth, fheight, d_w, d_h); int vo_panscan_area = window_h - fheight; - if (!vo_panscan_area) + double f_w = fwidth / (double)fheight; + double f_h = 1; + if (!vo_panscan_area) { vo_panscan_area = window_w - fwidth; + f_w = 1; + f_h = fheight / (double)fwidth; + } - *out_w = fwidth + vo_panscan_area * opts->panscan * fwidth / fheight; - *out_h = fheight + vo_panscan_area * opts->panscan; + *out_w = fwidth + vo_panscan_area * opts->panscan * f_w; + *out_h = fheight + vo_panscan_area * opts->panscan * f_h; } // Clamp [start, end) to range [0, size) with various fallbacks. -- cgit v1.2.3