aboutsummaryrefslogtreecommitdiffstats
path: root/src/output_init.c
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2009-12-14 21:36:25 +0100
committerMax Kellermann <max@duempel.org>2009-12-25 17:51:08 +0100
commit870436a592b081c4630b9ecc36ff8daecf6496cc (patch)
tree96aca67066a54b308cd2958467bb17b81234f3fb /src/output_init.c
parent6a17233f78d177bacc3b13fa4e8ac15fe08a4f51 (diff)
downloadmpd-870436a592b081c4630b9ecc36ff8daecf6496cc.tar.gz
mpd-870436a592b081c4630b9ecc36ff8daecf6496cc.tar.xz
mpd-870436a592b081c4630b9ecc36ff8daecf6496cc.zip
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.
Diffstat (limited to '')
-rw-r--r--src/output_init.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/output_init.c b/src/output_init.c
index ab5257829..fe9e4d86a 100644
--- a/src/output_init.c
+++ b/src/output_init.c
@@ -31,6 +31,7 @@
#include "filter_registry.h"
#include "filter_config.h"
#include "filter/chain_filter_plugin.h"
+#include "filter/autoconvert_filter_plugin.h"
#include <glib.h>
@@ -192,6 +193,16 @@ audio_output_init(struct audio_output *ao, const struct config_param *param,
ao->filter = filter_chain_new();
assert(ao->filter != NULL);
+
+ if (config_get_bool(CONF_VOLUME_NORMALIZATION, false)) {
+ struct filter *normalize_filter =
+ filter_new(&normalize_filter_plugin, NULL, NULL);
+ assert(normalize_filter != NULL);
+
+ filter_chain_append(ao->filter,
+ autoconvert_filter_new(normalize_filter));
+ }
+
filter_chain_parse(ao->filter,
config_get_block_string(param, AUDIO_FILTERS, ""),
&error