changeset 1551:85028cd13cf1 libavcodec

BSD doesnt have log2
author michael
date Tue, 21 Oct 2003 01:00:31 +0000
parents fca47124001d
children 26c6ecba99a1
files rational.c
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/rational.c	Mon Oct 20 23:24:39 2003 +0000
+++ b/rational.c	Tue Oct 21 01:00:31 2003 +0000
@@ -53,7 +53,7 @@
 
 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);