summaryrefslogtreecommitdiffstats
path: root/video/filter/vf_lavfi.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-10-09 18:18:05 +0200
committerwm4 <wm4@nowhere>2014-10-09 18:18:05 +0200
commitfef9ea5f6282b294cc1863dcc9e630e5ad9684ba (patch)
tree3bf8b2ec5a87ada7d43aaf6f62dcec3b820e2072 /video/filter/vf_lavfi.c
parentbc6b8caa6d461a1c536f435d5b76cda903ae4f4a (diff)
downloadmpv-fef9ea5f6282b294cc1863dcc9e630e5ad9684ba.tar.bz2
mpv-fef9ea5f6282b294cc1863dcc9e630e5ad9684ba.tar.xz
vf_lavfi: proper rounding for lavfi->mpv aspect ratio
Or so I think. Not like it matters anyway.
Diffstat (limited to 'video/filter/vf_lavfi.c')
-rw-r--r--video/filter/vf_lavfi.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/video/filter/vf_lavfi.c b/video/filter/vf_lavfi.c
index c806e17203..da455f1c09 100644
--- a/video/filter/vf_lavfi.c
+++ b/video/filter/vf_lavfi.c
@@ -20,6 +20,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include <math.h>
#include <inttypes.h>
#include <stdarg.h>
#include <assert.h>
@@ -116,9 +117,9 @@ static void dar_from_sar_par(int width, int height, AVRational par,
if (par.num != 0 && par.den != 0) {
double d = av_q2d(par);
if (d > 1.0) {
- *out_dw *= d;
+ *out_dw = floor(*out_dw * d + 0.5);
} else {
- *out_dh /= d;
+ *out_dh = floor(*out_dh / d + 0.5);
}
}
}