From fef9ea5f6282b294cc1863dcc9e630e5ad9684ba Mon Sep 17 00:00:00 2001 From: wm4 Date: Thu, 9 Oct 2014 18:18:05 +0200 Subject: vf_lavfi: proper rounding for lavfi->mpv aspect ratio Or so I think. Not like it matters anyway. --- video/filter/vf_lavfi.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'video/filter/vf_lavfi.c') 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 #include #include +#include #include #include #include @@ -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); } } } -- cgit v1.2.3