Revision 62b9fc15

View differences:

libavutil/rational.c
46 46
    }
47 47

  
48 48
    while(den){
49
        int64_t x       = nom / den;
49
        uint64_t x      = nom / den;
50 50
        int64_t next_den= nom - den*x;
51 51
        int64_t a2n= x*a1.num + a0.num;
52 52
        int64_t a2d= x*a1.den + a0.den;
......
55 55
            if(a1.num) x= (max - a0.num) / a1.num;
56 56
            if(a1.den) x= FFMIN(x, (max - a0.den) / a1.den);
57 57

  
58
            // Won't overflow, sum == original denominator
59 58
            if (den*(2*x*a1.den + a0.den) > nom*a1.den)
60 59
                a1 = (AVRational){x*a1.num + a0.num, x*a1.den + a0.den};
61 60
            break;

Also available in: Unified diff