[FFmpeg-cvslog] r25338 - in trunk/libavutil: avutil.h rational.h
michael
subversion
Tue Oct 5 03:43:31 CEST 2010
Author: michael
Date: Tue Oct 5 03:43:31 2010
New Revision: 25338
Log:
Make av_cmp_q() work with infinities and NAN.
Modified:
trunk/libavutil/avutil.h
trunk/libavutil/rational.h
Modified: trunk/libavutil/avutil.h
==============================================================================
--- trunk/libavutil/avutil.h Tue Oct 5 03:43:25 2010 (r25337)
+++ trunk/libavutil/avutil.h Tue Oct 5 03:43:31 2010 (r25338)
@@ -41,7 +41,7 @@
#define LIBAVUTIL_VERSION_MAJOR 50
#define LIBAVUTIL_VERSION_MINOR 32
-#define LIBAVUTIL_VERSION_MICRO 1
+#define LIBAVUTIL_VERSION_MICRO 2
#define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \
LIBAVUTIL_VERSION_MINOR, \
Modified: trunk/libavutil/rational.h
==============================================================================
--- trunk/libavutil/rational.h Tue Oct 5 03:43:25 2010 (r25337)
+++ trunk/libavutil/rational.h Tue Oct 5 03:43:31 2010 (r25338)
@@ -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,
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;
}
/**
More information about the ffmpeg-cvslog
mailing list