summaryrefslogtreecommitdiffstats
path: root/video
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2013-12-13 22:25:38 +0100
committerwm4 <wm4@nowhere>2013-12-13 22:25:38 +0100
commit37319ab64452a605c4178711227383f0df31473e (patch)
treeae95765112aa3d6d70a63e3ef24dbb4c370bf332 /video
parentebf6d0004b7d574e6013d648fb9d78dfac06c26b (diff)
downloadmpv-37319ab64452a605c4178711227383f0df31473e.tar.bz2
mpv-37319ab64452a605c4178711227383f0df31473e.tar.xz
video: change --video-zoom behavior
Use the scaled video size (i.e. as shown on the window) as reference for zoom. This is the easiest way to fix different width/height scale factors as they happen when zooming video with a pixel aspect ratio other than 1:1. Also fix the unscaled mode, so that it 1. doesn't scale even with --video-zoom, and 2. doesn't scale by small amounts when the video is cropped by making the window smaller than the video.
Diffstat (limited to 'video')
-rw-r--r--video/out/vo.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/video/out/vo.c b/video/out/vo.c
index 578fc18fd0..0eb04a6d1f 100644
--- a/video/out/vo.c
+++ b/video/out/vo.c
@@ -508,10 +508,12 @@ static void src_dst_split_scaling(int src_size, int dst_size,
int *dst_start, int *dst_end,
int *osd_margin_a, int *osd_margin_b)
{
- if (unscaled)
+ if (unscaled) {
scaled_src_size = src_size;
+ zoom = 0.0;
+ }
- scaled_src_size += zoom * src_size;
+ scaled_src_size += zoom * scaled_src_size;
align = (align + 1) / 2;
*src_start = 0;
@@ -537,7 +539,7 @@ static void src_dst_split_scaling(int src_size, int dst_size,
*dst_end = dst_size;
}
- if (unscaled && zoom == 1.0) {
+ if (unscaled) {
// Force unscaled by reducing the range for src or dst
int src_s = *src_end - *src_start;
int dst_s = *dst_end - *dst_start;