diff options
author | Tim Phipps <mpd@phipps-hutton.freeserve.co.uk> | 2010-01-28 20:54:04 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2010-01-28 20:54:04 +0100 |
commit | 891dab7b915ae30490b2dd8e0a91884badaab655 (patch) | |
tree | 3366438c90b00fb5c02fd529e09fa8949454f558 /src/decoder | |
parent | 7a24e496d557782b58dd7d178b6bb134bff3d611 (diff) | |
download | mpd-891dab7b915ae30490b2dd8e0a91884badaab655.tar.gz mpd-891dab7b915ae30490b2dd8e0a91884badaab655.tar.xz mpd-891dab7b915ae30490b2dd8e0a91884badaab655.zip |
decoder/flac: fix replay gain (short-circuiting "or")
Diffstat (limited to '')
-rw-r--r-- | src/decoder/flac_metadata.c | 21 |
1 files 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; |