From 870436a592b081c4630b9ecc36ff8daecf6496cc Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Mon, 14 Dec 2009 21:36:25 +0100 Subject: output_init: use the normalize filter plugin Use the plugin instead of the glue code in normalize.c. This is used wrapped inside a "autoconv" filter, to enable normalization for all input file formats. --- test/run_normalize.c | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) (limited to 'test') diff --git a/test/run_normalize.c b/test/run_normalize.c index 979be9201..33446d884 100644 --- a/test/run_normalize.c +++ b/test/run_normalize.c @@ -24,10 +24,9 @@ */ #include "config.h" -#include "normalize.h" +#include "AudioCompress/compress.h" #include "audio_parser.h" #include "audio_format.h" -#include "conf.h" #include @@ -35,20 +34,12 @@ #include #include -bool -config_get_bool(const char *name, bool default_value) -{ - if (strcmp(name, CONF_VOLUME_NORMALIZATION) == 0) - return true; - else - return default_value; -} - int main(int argc, char **argv) { GError *error = NULL; struct audio_format audio_format; bool ret; + struct Compressor *compressor; static char buffer[4096]; ssize_t nbytes; @@ -68,12 +59,13 @@ int main(int argc, char **argv) } else audio_format_init(&audio_format, 48000, 16, 2); - initNormalization(); + compressor = Compressor_new(0); while ((nbytes = read(0, buffer, sizeof(buffer))) > 0) { - normalizeData(buffer, nbytes, &audio_format); + Compressor_Process_int16(compressor, + (int16_t *)buffer, nbytes / 2); write(1, buffer, nbytes); } - finishNormalization(); + Compressor_delete(compressor); } -- cgit v1.2.3