aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/inputPlugins/mpc_plugin.c9
-rw-r--r--src/replayGain.c4
2 files changed, 7 insertions, 6 deletions
diff --git a/src/inputPlugins/mpc_plugin.c b/src/inputPlugins/mpc_plugin.c
index 9687eba6c..f4c1aa8df 100644
--- a/src/inputPlugins/mpc_plugin.c
+++ b/src/inputPlugins/mpc_plugin.c
@@ -34,6 +34,7 @@
#include <string.h>
#include <musepack/musepack.h>
#include <errno.h>
+#include <math.h>
typedef struct _MpcCallbackData {
InputStream * inStream;
@@ -182,10 +183,10 @@ static int mpc_decode(OutputBuffer * cb, DecoderControl * dc,
getOutputAudioFormat(&(dc->audioFormat), &(cb->audioFormat));
replayGainInfo = newReplayGainInfo();
- /*replayGainInfo->albumGain = info.gain_album;
- replayGainInfo->albumPeak = info.peak_album;
- replayGainInfo->trackGain = info.gain_title;
- replayGainInfo->trackPeak = info.peak_title;*/
+ replayGainInfo->albumGain = info.gain_album * 0.01;
+ replayGainInfo->albumPeak = info.peak_album / 32767.0;
+ replayGainInfo->trackGain = info.gain_title * 0.01;
+ replayGainInfo->trackPeak = info.peak_title / 32767.0;
dc->state = DECODE_STATE_DECODE;
diff --git a/src/replayGain.c b/src/replayGain.c
index 138d3a68b..ea521d728 100644
--- a/src/replayGain.c
+++ b/src/replayGain.c
@@ -89,10 +89,10 @@ ReplayGainInfo * newReplayGainInfo() {
ReplayGainInfo * ret = malloc(sizeof(ReplayGainInfo));
ret->albumGain = 0.0;
- ret->albumPeak = 1.0;
+ ret->albumPeak = 0.0;
ret->trackGain = 0.0;
- ret->trackPeak = 1.0;
+ ret->trackPeak = 0.0;
/* set to -1 so that we know in doReplayGain to compute the scale */
ret->scale = -1.0;