aboutsummaryrefslogtreecommitdiff
path: root/libavutil
diff options
context:
space:
mode:
authorMichael Niedermayer2014-06-06 20:25:04 +0200
committerMichael Niedermayer2014-06-06 21:00:11 +0200
commite374e77292840d3646c78bb908c6a6373e772431 (patch)
treeee4da94760d96899b865b7a43ec50551f20b4d68 /libavutil
parent049b20b287397b68804649673da32043d3908b77 (diff)
avutil/libm: fix fminf() emulation build failure due to undefined FFMIN
Found-by: James Almer <jamrial@gmail.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavutil')
-rw-r--r--libavutil/libm.h4
1 files changed, 3 insertions, 1 deletions
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