diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2013-05-25 15:38:07 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2013-05-25 16:04:08 +0200 |
commit | 64eacb839e0d1bde1b55d94d2ff5477d497e6d75 (patch) | |
tree | f969cd8d6eec20ac40155b52a33464e790e661a1 /libavutil | |
parent | de7d29063133b240a9fe2c26049b35a6a028c8a1 (diff) | |
download | ffmpeg-64eacb839e0d1bde1b55d94d2ff5477d497e6d75.tar.gz |
av_d2q: fix rounding for negative values
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavutil')
-rw-r--r-- | libavutil/rational.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libavutil/rational.c b/libavutil/rational.c index 5b9b86fb6d..912abc3f05 100644 --- a/libavutil/rational.c +++ b/libavutil/rational.c @@ -114,7 +114,7 @@ AVRational av_d2q(double d, int max) return (AVRational) { d < 0 ? -1 : 1, 0 }; exponent = FFMAX( (int)(log(fabs(d) + 1e-20)/LOG2), 0); den = 1LL << (61 - exponent); - av_reduce(&a.num, &a.den, (int64_t)(d * den + 0.5), den, max); + av_reduce(&a.num, &a.den, llrint(d * den), den, max); return a; } |