From 33a6984b8c85bead476f9db24ecdcda6dae71a57 Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Tue, 21 Oct 2003 01:00:31 +0000 Subject: [PATCH] BSD doesnt have log2 Originally committed as revision 2407 to svn://svn.ffmpeg.org/ffmpeg/trunk --- libavcodec/rational.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/rational.c b/libavcodec/rational.c index f2a579abca7..92db8bbe3ec 100644 --- a/libavcodec/rational.c +++ b/libavcodec/rational.c @@ -53,7 +53,7 @@ AVRational av_sub_q(AVRational b, AVRational c){ AVRational av_d2q(double d, int max){ AVRational a; - int exponent= FFMAX( (int)log2(ABS(d) + 1e-20), 0); + int exponent= FFMAX( (int)(log(ABS(d) + 1e-20)/log(2)), 0); int64_t den= 1LL << (61 - exponent); av_reduce(&a.num, &a.den, (int64_t)(d * den + 0.5), den, max); -- 2.39.2