Revision 33a6984b libavcodec/rational.c

View differences:

libavcodec/rational.c
53 53

  
54 54
AVRational av_d2q(double d, int max){
55 55
    AVRational a;
56
    int exponent= FFMAX( (int)log2(ABS(d) + 1e-20), 0);
56
    int exponent= FFMAX( (int)(log(ABS(d) + 1e-20)/log(2)), 0);
57 57
    int64_t den= 1LL << (61 - exponent);
58 58
    av_reduce(&a.num, &a.den, (int64_t)(d * den + 0.5), den, max);
59 59

  

Also available in: Unified diff