hopefully replaygain now works for musepack

git-svn-id: https://svn.musicpd.org/mpd/trunk@3031 09075e82-0dd4-0310-85a5-a0d7c8717e4f
This commit is contained in:
Warren Dukes
2005-03-07 01:30:29 +00:00
parent 01b708bc13
commit 3764b06083
2 changed files with 7 additions and 6 deletions

View File

@@ -34,6 +34,7 @@
#include <string.h> #include <string.h>
#include <musepack/musepack.h> #include <musepack/musepack.h>
#include <errno.h> #include <errno.h>
#include <math.h>
typedef struct _MpcCallbackData { typedef struct _MpcCallbackData {
InputStream * inStream; InputStream * inStream;
@@ -182,10 +183,10 @@ static int mpc_decode(OutputBuffer * cb, DecoderControl * dc,
getOutputAudioFormat(&(dc->audioFormat), &(cb->audioFormat)); getOutputAudioFormat(&(dc->audioFormat), &(cb->audioFormat));
replayGainInfo = newReplayGainInfo(); replayGainInfo = newReplayGainInfo();
/*replayGainInfo->albumGain = info.gain_album; replayGainInfo->albumGain = info.gain_album * 0.01;
replayGainInfo->albumPeak = info.peak_album; replayGainInfo->albumPeak = info.peak_album / 32767.0;
replayGainInfo->trackGain = info.gain_title; replayGainInfo->trackGain = info.gain_title * 0.01;
replayGainInfo->trackPeak = info.peak_title;*/ replayGainInfo->trackPeak = info.peak_title / 32767.0;
dc->state = DECODE_STATE_DECODE; dc->state = DECODE_STATE_DECODE;

View File

@@ -89,10 +89,10 @@ ReplayGainInfo * newReplayGainInfo() {
ReplayGainInfo * ret = malloc(sizeof(ReplayGainInfo)); ReplayGainInfo * ret = malloc(sizeof(ReplayGainInfo));
ret->albumGain = 0.0; ret->albumGain = 0.0;
ret->albumPeak = 1.0; ret->albumPeak = 0.0;
ret->trackGain = 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 */ /* set to -1 so that we know in doReplayGain to compute the scale */
ret->scale = -1.0; ret->scale = -1.0;