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
This commit is contained in:
Warren Dukes 2004-08-13 03:54:31 +00:00
parent ce2fe32c54
commit 63efaae0ee
2 changed files with 10 additions and 6 deletions

View File

@ -352,16 +352,16 @@ void flacParseReplayGain(const FLAC__StreamMetadata *block, FlacData * data) {
} }
if(!found || state == REPLAYGAIN_TRACK) { if(!found || state == REPLAYGAIN_TRACK) {
if(flacFindVorbisCommentFloat(block,"replaygain_track_gain", found = flacFindVorbisCommentFloat(block,
&gain)) "replaygain_track_gain", &gain);
{ if(found) {
peak = 0.0; peak = 0.0;
flacFindVorbisCommentFloat(block, flacFindVorbisCommentFloat(block,
"replaygain_track_peak",&peak); "replaygain_track_peak",&peak);
} }
} }
data->replayGainScale = computeReplayGainScale(gain,peak); if(found) data->replayGainScale = computeReplayGainScale(gain,peak);
} }
void flacMetadata(const FLAC__SeekableStreamDecoder *dec, void flacMetadata(const FLAC__SeekableStreamDecoder *dec,

View File

@ -157,12 +157,16 @@ float ogg_getReplayGainScale(char ** comments) {
if(albumGainFound) { if(albumGainFound) {
return computeReplayGainScale(albumGain,albumPeak); return computeReplayGainScale(albumGain,albumPeak);
} }
return computeReplayGainScale(trackGain,trackPeak); else if(trackGainFound) {
return computeReplayGainScale(trackGain,trackPeak);
}
case REPLAYGAIN_TRACK: case REPLAYGAIN_TRACK:
if(trackGainFound) { if(trackGainFound) {
return computeReplayGainScale(trackGain,trackPeak); return computeReplayGainScale(trackGain,trackPeak);
} }
return computeReplayGainScale(albumGain,albumPeak); else if(albumGainFound) {
return computeReplayGainScale(albumGain,albumPeak);
}
} }
return 1.0; return 1.0;