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:
parent
ce2fe32c54
commit
63efaae0ee
@ -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,
|
||||||
|
@ -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;
|
||||||
|
Loading…
Reference in New Issue
Block a user