decoder/flac: fix replay gain (short-circuiting "or")

This commit is contained in:
Tim Phipps 2010-01-28 20:54:04 +01:00 committed by Max Kellermann
parent 7a24e496d5
commit 891dab7b91
1 changed files with 13 additions and 8 deletions

View File

@ -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;