summaryrefslogtreecommitdiffstats
path: root/video/filter/vf_lavfi.c
diff options
context:
space:
mode:
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);
}
}
}