aboutsummaryrefslogtreecommitdiffstats
path: root/src/inputPlugins
diff options
context:
space:
mode:
authorWarren Dukes <warren.dukes@gmail.com>2005-03-07 01:30:29 +0000
committerWarren Dukes <warren.dukes@gmail.com>2005-03-07 01:30:29 +0000
commit3764b0608348815a9a8c59a0e4cb28236d82cb7d (patch)
tree6cf9da8a96840dc7b91f354e02a0d29859a559f0 /src/inputPlugins
parent01b708bc13d082079beb794a11e138b2ad890f83 (diff)
downloadmpd-3764b0608348815a9a8c59a0e4cb28236d82cb7d.tar.gz
mpd-3764b0608348815a9a8c59a0e4cb28236d82cb7d.tar.xz
mpd-3764b0608348815a9a8c59a0e4cb28236d82cb7d.zip
hopefully replaygain now works for musepack
git-svn-id: https://svn.musicpd.org/mpd/trunk@3031 09075e82-0dd4-0310-85a5-a0d7c8717e4f
Diffstat (limited to '')
-rw-r--r--src/inputPlugins/mpc_plugin.c9
1 files changed, 5 insertions, 4 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;