|
|
|
@@ -29,6 +29,7 @@ |
|
|
|
#define AVUTIL_RATIONAL_H |
|
|
|
|
|
|
|
#include <stdint.h> |
|
|
|
#include <limits.h> |
|
|
|
#include "attributes.h" |
|
|
|
|
|
|
|
/** |
|
|
|
@@ -49,7 +50,9 @@ static inline int av_cmp_q(AVRational a, AVRational b){ |
|
|
|
const int64_t tmp= a.num * (int64_t)b.den - b.num * (int64_t)a.den; |
|
|
|
|
|
|
|
if(tmp) return ((tmp ^ a.den ^ b.den)>>63)|1; |
|
|
|
else return 0; |
|
|
|
else if(b.den && a.den) return 0; |
|
|
|
else if(a.num && b.num) return (a.num>>31) - (b.num>>31); |
|
|
|
else return INT_MIN; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
|