aboutsummaryrefslogtreecommitdiffstats
path: root/src/decoder/flac_metadata.c
diff options
context:
space:
mode:
authorTim Phipps <mpd@phipps-hutton.freeserve.co.uk>2010-01-28 20:54:04 +0100
committerMax Kellermann <max@duempel.org>2010-01-28 20:54:04 +0100
commit891dab7b915ae30490b2dd8e0a91884badaab655 (patch)
tree3366438c90b00fb5c02fd529e09fa8949454f558 /src/decoder/flac_metadata.c
parent7a24e496d557782b58dd7d178b6bb134bff3d611 (diff)
downloadmpd-891dab7b915ae30490b2dd8e0a91884badaab655.tar.gz
mpd-891dab7b915ae30490b2dd8e0a91884badaab655.tar.xz
mpd-891dab7b915ae30490b2dd8e0a91884badaab655.zip
decoder/flac: fix replay gain (short-circuiting "or")
Diffstat (limited to 'src/decoder/flac_metadata.c')
-rw-r--r--src/decoder/flac_metadata.c21
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;