From 891dab7b915ae30490b2dd8e0a91884badaab655 Mon Sep 17 00:00:00 2001 From: Tim Phipps Date: Thu, 28 Jan 2010 20:54:04 +0100 Subject: decoder/flac: fix replay gain (short-circuiting "or") --- src/decoder/flac_metadata.c | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/src/decoder/flac_metadata.c b/src/decoder/flac_metadata.c index 2bfb1a6f8..2ee1d8234 100644 --- a/src/decoder/flac_metadata.c +++ b/src/decoder/flac_metadata.c @@ -64,14 +64,19 @@ flac_parse_replay_gain(const FLAC__StreamMetadata *block) rgi = replay_gain_info_new(); - found = flac_find_float_comment(block, "replaygain_album_gain", - &rgi->tuples[REPLAY_GAIN_ALBUM].gain) || - flac_find_float_comment(block, "replaygain_album_peak", - &rgi->tuples[REPLAY_GAIN_ALBUM].peak) || - flac_find_float_comment(block, "replaygain_track_gain", - &rgi->tuples[REPLAY_GAIN_TRACK].gain) || - flac_find_float_comment(block, "replaygain_track_peak", - &rgi->tuples[REPLAY_GAIN_TRACK].peak); + if (flac_find_float_comment(block, "replaygain_album_gain", + &rgi->tuples[REPLAY_GAIN_ALBUM].gain)) + found = true; + if (flac_find_float_comment(block, "replaygain_album_peak", + &rgi->tuples[REPLAY_GAIN_ALBUM].peak)) + found = true; + if (flac_find_float_comment(block, "replaygain_track_gain", + &rgi->tuples[REPLAY_GAIN_TRACK].gain)) + found = true; + if (flac_find_float_comment(block, "replaygain_track_peak", + &rgi->tuples[REPLAY_GAIN_TRACK].peak)) + found = true; + if (!found) { replay_gain_info_free(rgi); rgi = NULL; -- cgit v1.2.3