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.
This commit is contained in:
Wim Taymans 2025-03-26 10:26:41 +01:00
parent 636e123fdd
commit ea7cfb9e94
2 changed files with 3 additions and 1 deletions

View file

@ -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);

View file

@ -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;