summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2015-06-29 23:46:59 +0200
committerwm4 <wm4@nowhere>2015-06-29 23:46:59 +0200
commit2e4f106ef87f3f42d88b8d76313967700437e271 (patch)
treeca38bac59061d5c47a000504eb3c21547fd14343
parent8b479d2f664f0c64905e2b76bae6746459830723 (diff)
downloadmpv-2e4f106ef87f3f42d88b8d76313967700437e271.tar.bz2
mpv-2e4f106ef87f3f42d88b8d76313967700437e271.tar.xz
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.
-rw-r--r--video/out/aspect.c11
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.