aboutsummaryrefslogtreecommitdiffstats
path: root/src/inputPlugins
diff options
context:
space:
mode:
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;