aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorWarren Dukes <warren.dukes@gmail.com>2004-08-13 03:54:31 +0000
committerWarren Dukes <warren.dukes@gmail.com>2004-08-13 03:54:31 +0000
commit63efaae0eecc391b157fed544af1b72af50e5a63 (patch)
tree3894c90f7b8c14d54e99b97c7b4dcc5f3b74253b /src
parentce2fe32c54573afc2a64af5b06d3f42ec08f16ce (diff)
downloadmpd-63efaae0eecc391b157fed544af1b72af50e5a63.tar.gz
mpd-63efaae0eecc391b157fed544af1b72af50e5a63.tar.xz
mpd-63efaae0eecc391b157fed544af1b72af50e5a63.zip
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
Diffstat (limited to '')
-rw-r--r--src/inputPlugins/flac_plugin.c8
-rw-r--r--src/inputPlugins/ogg_plugin.c8
2 files changed, 10 insertions, 6 deletions
diff --git a/src/inputPlugins/flac_plugin.c b/src/inputPlugins/flac_plugin.c
index eec99f233..5d1a4e02f 100644
--- a/src/inputPlugins/flac_plugin.c
+++ b/src/inputPlugins/flac_plugin.c
@@ -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,
diff --git a/src/inputPlugins/ogg_plugin.c b/src/inputPlugins/ogg_plugin.c
index c65de71aa..5d461586e 100644
--- a/src/inputPlugins/ogg_plugin.c
+++ b/src/inputPlugins/ogg_plugin.c
@@ -157,12 +157,16 @@ float ogg_getReplayGainScale(char ** comments) {
if(albumGainFound) {
return computeReplayGainScale(albumGain,albumPeak);
}
- return computeReplayGainScale(trackGain,trackPeak);
+ else if(trackGainFound) {
+ return computeReplayGainScale(trackGain,trackPeak);
+ }
case REPLAYGAIN_TRACK:
if(trackGainFound) {
return computeReplayGainScale(trackGain,trackPeak);
}
- return computeReplayGainScale(albumGain,albumPeak);
+ else if(albumGainFound) {
+ return computeReplayGainScale(albumGain,albumPeak);
+ }
}
return 1.0;