From e374e77292840d3646c78bb908c6a6373e772431 Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Fri, 6 Jun 2014 20:25:04 +0200 Subject: [PATCH] avutil/libm: fix fminf() emulation build failure due to undefined FFMIN Found-by: James Almer Signed-off-by: Michael Niedermayer --- libavutil/libm.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libavutil/libm.h b/libavutil/libm.h index 13e6cfe181..28d5df871b 100644 --- a/libavutil/libm.h +++ b/libavutil/libm.h @@ -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