vf_lavfi: proper rounding for lavfi->mpv aspect ratio

Or so I think. Not like it matters anyway.
This commit is contained in:
wm4 2014-10-09 18:18:05 +02:00
parent bc6b8caa6d
commit fef9ea5f62
1 changed files with 3 additions and 2 deletions

View File

@ -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);
}
}
}