diff options
author | wm4 <wm4@nowhere> | 2014-02-19 15:37:47 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2014-03-11 00:13:57 +0100 |
commit | c1ed4dc242f879b1080ad445df74fe60bc690584 (patch) | |
tree | 1e8e81d17f0e5921a1f1795ce04049d273e2739b /video/filter/vf.c | |
parent | 712657a89432adfa393f3159d70045ed7bf69162 (diff) | |
download | mpv-c1ed4dc242f879b1080ad445df74fe60bc690584.tar.bz2 mpv-c1ed4dc242f879b1080ad445df74fe60bc690584.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/filter/vf.c')
-rw-r--r-- | video/filter/vf.c | 4 |
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; } } } |