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.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/replay_gain_info.c') diff --git a/src/replay_gain_info.c b/src/replay_gain_info.c index ce9d84950..33e29e8e3 100644 --- a/src/replay_gain_info.c +++ b/src/replay_gain_info.c @@ -21,7 +21,6 @@ #include "replay_gain_info.h" #include -#include struct replay_gain_info * replay_gain_info_new(void) @@ -29,7 +28,7 @@ replay_gain_info_new(void) struct replay_gain_info *ret = g_new(struct replay_gain_info, 1); for (unsigned i = 0; i < G_N_ELEMENTS(ret->tuples); ++i) { - ret->tuples[i].gain = 0.0; + ret->tuples[i].gain = INFINITY; ret->tuples[i].peak = 0.0; } -- cgit v1.2.3