diff options
author | Max Kellermann <max@duempel.org> | 2010-02-14 17:04:39 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2010-02-17 07:23:13 +0100 |
commit | 752dfb3d95482c562e5d24c6ea839c4815de9a6d (patch) | |
tree | 46b62f26c4c68ebe81b72b9ca30366ffa14af1a5 /src/output_init.c | |
parent | 5e0117b4441f257fcb1aab48b42a787567ebcbe6 (diff) | |
download | mpd-752dfb3d95482c562e5d24c6ea839c4815de9a6d.tar.gz mpd-752dfb3d95482c562e5d24c6ea839c4815de9a6d.tar.xz mpd-752dfb3d95482c562e5d24c6ea839c4815de9a6d.zip |
replay_gain: reimplement as a filter plugin
Apply the replay gain in the output thread. This means a new setting
will be active instantly, without going through the whole music pipe.
And we might have different replay gain settings for each audio output
device.
Diffstat (limited to '')
-rw-r--r-- | src/output_init.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/output_init.c b/src/output_init.c index 2ce6b30f9..387915ddc 100644 --- a/src/output_init.c +++ b/src/output_init.c @@ -194,6 +194,17 @@ audio_output_init(struct audio_output *ao, const struct config_param *param, ao->filter = filter_chain_new(); assert(ao->filter != NULL); + /* create the replay_gain filter */ + + ao->replay_gain_filter = filter_new(&replay_gain_filter_plugin, + param, NULL); + assert(ao->replay_gain_filter != NULL); + + filter_chain_append(ao->filter, ao->replay_gain_filter); + ao->replay_gain_serial = 0; + + /* create the normalization filter (if configured) */ + if (config_get_bool(CONF_VOLUME_NORMALIZATION, false)) { struct filter *normalize_filter = filter_new(&normalize_filter_plugin, NULL, NULL); |