summaryrefslogtreecommitdiffstats
path: root/video
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-02-19 15:37:47 +0100
committerwm4 <wm4@nowhere>2014-02-19 15:37:47 +0100
commit5d7cf6e508760ad0e8b2e94e21a60fd21b729c6d (patch)
tree95d2b7b0aef9d9797b92a44edc204fd722488d78 /video
parent283139607c8ba020b06bee6c06b438f8f1d13ba7 (diff)
downloadmpv-5d7cf6e508760ad0e8b2e94e21a60fd21b729c6d.tar.bz2
mpv-5d7cf6e508760ad0e8b2e94e21a60fd21b729c6d.tar.xz
video: add rounding to aspect ratio calculations
Small errors are unavoidable, but truncation can cause anamorphic video to be off by 1 or 2 pixels.
Diffstat (limited to 'video')
-rw-r--r--video/filter/vf.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/video/filter/vf.c b/video/filter/vf.c
index 4600e9e375..001363b5fb 100644
--- a/video/filter/vf.c
+++ b/video/filter/vf.c
@@ -599,11 +599,11 @@ void vf_set_dar(int *d_w, int *d_h, int w, int h, double dar)
*d_w = w;
*d_h = h;
if (dar > 0.01) {
- *d_w = h * dar;
+ *d_w = h * dar + 0.5;
// we don't like horizontal downscale
if (*d_w < w) {
*d_w = w;
- *d_h = w / dar;
+ *d_h = w / dar + 0.5;
}
}
}