]> git.sesse.net Git - ffmpeg/commitdiff
avutil/libm: fix fminf() emulation build failure due to undefined FFMIN
authorMichael Niedermayer <michaelni@gmx.at>
Fri, 6 Jun 2014 18:25:04 +0000 (20:25 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Fri, 6 Jun 2014 19:00:11 +0000 (21:00 +0200)
Found-by: James Almer <jamrial@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavutil/libm.h

index 13e6cfe1818b49faae7a5615ce4c313261423454..28d5df871b39a1a8f99bc9540d7f9a8ccd840d59 100644 (file)
@@ -86,7 +86,9 @@ static av_always_inline float cbrtf(float x)
 #undef fminf
 static av_always_inline av_const float fminf(float x, float y)
 {
-    return FFMIN(x, y);
+    //Note, the NaN special case is needed for C spec compliance, it should be
+    //optimized away if the users compiler is configured to assume no NaN
+    return x > y ? y : (x == x ? x : y);
 }
 #endif