From ea7cfb9e94d03376fa8e8965c9be8cc45fa50907 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Wed, 26 Mar 2025 10:26:41 +0100 Subject: [PATCH] audioconvert: make sure the converter is in None mode The audioconverter starts in Convert mode, so make sure it goes to the None mode before we attempt to reconfigure ourselves. Also remove the ports on audioconvert when going to None mode. This used to somewhat work because we configured it in DSP mode without any params, which is like None without ports. --- spa/plugins/audioconvert/audioadapter.c | 3 ++- spa/plugins/audioconvert/audioconvert.c | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/spa/plugins/audioconvert/audioadapter.c b/spa/plugins/audioconvert/audioadapter.c index 92474a636..631c0bff1 100644 --- a/spa/plugins/audioconvert/audioadapter.c +++ b/spa/plugins/audioconvert/audioadapter.c @@ -2149,6 +2149,7 @@ impl_init(const struct spa_handle_factory *factory, this->target = this->convert; /* the actual mode is selected below */ this->mode = SPA_PARAM_PORT_CONFIG_MODE_none; + configure_convert(this, this->mode); } this->info_all = SPA_NODE_CHANGE_MASK_FLAGS | @@ -2179,7 +2180,7 @@ impl_init(const struct spa_handle_factory *factory, if (info && (str = spa_dict_lookup(info, "adapter.auto-port-config")) != NULL) do_auto_port_config(this, str); else { - reconfigure_mode(this, SPA_PARAM_PORT_CONFIG_MODE_dsp, this->direction, NULL); + reconfigure_mode(this, SPA_PARAM_PORT_CONFIG_MODE_none, this->direction, NULL); } } else { reconfigure_mode(this, SPA_PARAM_PORT_CONFIG_MODE_passthrough, this->direction, NULL); diff --git a/spa/plugins/audioconvert/audioconvert.c b/spa/plugins/audioconvert/audioconvert.c index 4e52b6cef..84813e12b 100644 --- a/spa/plugins/audioconvert/audioconvert.c +++ b/spa/plugins/audioconvert/audioconvert.c @@ -1775,6 +1775,7 @@ static int reconfigure_mode(struct impl *this, enum spa_param_port_config_mode m break; } case SPA_PARAM_PORT_CONFIG_MODE_none: + dir->n_ports = 0; break; default: return -ENOTSUP;