aboutsummaryrefslogtreecommitdiffstats
path: root/src/output_init.c
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2009-07-06 10:01:47 +0200
committerMax Kellermann <max@duempel.org>2009-07-06 10:01:47 +0200
commite47bdfe8e6f7da67c9714db7e650fa6a925f7847 (patch)
tree67f466706685a053da1549a9702ef0b0caa52715 /src/output_init.c
parentcd9c0a6b3e0a113d873483d214e1be1c37301b06 (diff)
downloadmpd-e47bdfe8e6f7da67c9714db7e650fa6a925f7847.tar.gz
mpd-e47bdfe8e6f7da67c9714db7e650fa6a925f7847.tar.xz
mpd-e47bdfe8e6f7da67c9714db7e650fa6a925f7847.zip
output: attach a filter chain to each audio_output
This patch adds initial filter support for audio outputs. Each audio output gets a "filter" attribute, which is used by ao_play_chunk(). The PCM conversion is now performed by convert_filter_plugin. audio_output.convert_state has been removed.
Diffstat (limited to 'src/output_init.c')
-rw-r--r--src/output_init.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/output_init.c b/src/output_init.c
index d72893ba8..3b2c9d54f 100644
--- a/src/output_init.c
+++ b/src/output_init.c
@@ -23,9 +23,14 @@
#include "output_list.h"
#include "audio_parser.h"
#include "mixer_control.h"
+#include "filter_plugin.h"
+#include "filter_registry.h"
+#include "filter/chain_filter_plugin.h"
#include <glib.h>
+#include <assert.h>
+
#undef G_LOG_DOMAIN
#define G_LOG_DOMAIN "output"
@@ -124,7 +129,15 @@ audio_output_init(struct audio_output *ao, const struct config_param *param,
ao->open = false;
ao->fail_timer = NULL;
- pcm_convert_init(&ao->convert_state);
+ /* set up the filter chain */
+
+ ao->filter = filter_chain_new();
+ assert(ao->filter != NULL);
+
+ ao->convert_filter = filter_new(&convert_filter_plugin, NULL, NULL);
+ assert(ao->convert_filter != NULL);
+
+ filter_chain_append(ao->filter, ao->convert_filter);
ao->config_audio_format = format != NULL;
if (ao->config_audio_format) {