diff --git a/spa/plugins/audioconvert/channelmix.c b/spa/plugins/audioconvert/channelmix.c index 55250faa9..b40dc85af 100644 --- a/spa/plugins/audioconvert/channelmix.c +++ b/spa/plugins/audioconvert/channelmix.c @@ -1181,6 +1181,7 @@ impl_init(const struct spa_handle_factory *factory, { struct impl *this; struct port *port; + const char *str; spa_return_val_if_fail(factory != NULL, -EINVAL); spa_return_val_if_fail(handle != NULL, -EINVAL); @@ -1198,6 +1199,15 @@ impl_init(const struct spa_handle_factory *factory, spa_hook_list_init(&this->hooks); + if (info != NULL) { + if ((str = spa_dict_lookup(info, "channelmix.normalize")) != NULL && + (strcmp(str, "true") == 0 || atoi(str) != 0)) + this->mix.options |= CHANNELMIX_OPTION_NORMALIZE; + if ((str = spa_dict_lookup(info, "channelmix.mix-lfe")) != NULL && + (strcmp(str, "true") == 0 || atoi(str) != 0)) + this->mix.options |= CHANNELMIX_OPTION_MIX_LFE; + } + this->node.iface = SPA_INTERFACE_INIT( SPA_TYPE_INTERFACE_Node, SPA_VERSION_NODE, diff --git a/src/pipewire/stream.c b/src/pipewire/stream.c index b1b530035..022eb0aa3 100644 --- a/src/pipewire/stream.c +++ b/src/pipewire/stream.c @@ -1534,6 +1534,7 @@ pw_stream_connect(struct pw_stream *stream, if ((str = pw_properties_get(props, PW_KEY_STREAM_MONITOR)) && pw_properties_parse_bool(str)) { pw_properties_set(props, "resample.peaks", "true"); + pw_properties_set(props, "channelmix.normalize", "true"); } follower = pw_context_create_node(impl->context, pw_properties_copy(props), 0);