aboutsummaryrefslogtreecommitdiffstats
path: root/src/normalize.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/normalize.c')
-rw-r--r--src/normalize.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/normalize.c b/src/normalize.c
index f8304cd1f..f9201df64 100644
--- a/src/normalize.c
+++ b/src/normalize.c
@@ -19,7 +19,7 @@
#include "config.h"
#include "normalize.h"
-#include "compress.h"
+#include "AudioCompress/compress.h"
#include "conf.h"
#include "audio_format.h"
@@ -27,24 +27,27 @@
int normalizationEnabled;
+static struct Compressor *compressor;
+
void initNormalization(void)
{
normalizationEnabled = config_get_bool(CONF_VOLUME_NORMALIZATION,
DEFAULT_VOLUME_NORMALIZATION);
if (normalizationEnabled)
- CompressCfg(0, ANTICLIP, TARGET, GAINMAX, GAINSMOOTH, BUCKETS);
+ compressor = Compressor_new(0);
}
void finishNormalization(void)
{
- if (normalizationEnabled) CompressFree();
+ if (normalizationEnabled)
+ Compressor_delete(compressor);
}
-void normalizeData(char *buffer, int bufferSize,
+void normalizeData(void *buffer, int bufferSize,
const struct audio_format *format)
{
if ((format->bits != 16) || (format->channels != 2)) return;
- CompressDo(buffer, bufferSize);
+ Compressor_Process_int16(compressor, buffer, bufferSize / 2);
}