Commit 63efaae0 authored by Warren Dukes's avatar Warren Dukes

don't call replaygain and cause preamp to beused if no replaygain tag exists

git-svn-id: https://svn.musicpd.org/mpd/trunk@2026 09075e82-0dd4-0310-85a5-a0d7c8717e4f
parent ce2fe32c
......@@ -352,16 +352,16 @@ void flacParseReplayGain(const FLAC__StreamMetadata *block, FlacData * data) {
}
if(!found || state == REPLAYGAIN_TRACK) {
if(flacFindVorbisCommentFloat(block,"replaygain_track_gain",
&gain))
{
found = flacFindVorbisCommentFloat(block,
"replaygain_track_gain", &gain);
if(found) {
peak = 0.0;
flacFindVorbisCommentFloat(block,
"replaygain_track_peak",&peak);
}
}
data->replayGainScale = computeReplayGainScale(gain,peak);
if(found) data->replayGainScale = computeReplayGainScale(gain,peak);
}
void flacMetadata(const FLAC__SeekableStreamDecoder *dec,
......
......@@ -157,13 +157,17 @@ float ogg_getReplayGainScale(char ** comments) {
if(albumGainFound) {
return computeReplayGainScale(albumGain,albumPeak);
}
else if(trackGainFound) {
return computeReplayGainScale(trackGain,trackPeak);
}
case REPLAYGAIN_TRACK:
if(trackGainFound) {
return computeReplayGainScale(trackGain,trackPeak);
}
else if(albumGainFound) {
return computeReplayGainScale(albumGain,albumPeak);
}
}
return 1.0;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment