From c05e6a1275621421eb0a7c3112b0401fa458841e Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Wed, 17 Feb 2010 07:07:00 +0100 Subject: replay_gain_info: use INFINITY to mark undefined values The previous patch not only moved code, it also changed the check. Negative gain values seem to be valid after all, there just was the "magic" value 0.0 which means "not available". This patch changes the "magic" value to "INFINITY", and uses the C99 function isinf() to check. It might have been a better idea to use "NAN", but the "NAN" macro is a GNU extension. --- src/replay_gain_info.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/replay_gain_info.h') diff --git a/src/replay_gain_info.h b/src/replay_gain_info.h index 9fcae22a..2465a250 100644 --- a/src/replay_gain_info.h +++ b/src/replay_gain_info.h @@ -23,6 +23,7 @@ #include "check.h" #include +#include enum replay_gain_mode { REPLAY_GAIN_OFF = -1, @@ -54,7 +55,7 @@ replay_gain_info_free(struct replay_gain_info *info); static inline bool replay_gain_tuple_defined(const struct replay_gain_tuple *tuple) { - return tuple->gain > 0.0; + return !isinf(tuple->gain); } float -- cgit v1.2.3