diff options
author | wm4 <wm4@nowhere> | 2015-06-29 23:46:59 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2015-06-29 23:46:59 +0200 |
commit | 2e4f106ef87f3f42d88b8d76313967700437e271 (patch) | |
tree | ca38bac59061d5c47a000504eb3c21547fd14343 /video | |
parent | 8b479d2f664f0c64905e2b76bae6746459830723 (diff) |
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.
Diffstat (limited to 'video')
-rw-r--r-- | video/out/aspect.c | 11 |
1 files changed, 8 insertions, 3 deletions
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. |