adapter: Improve convert setup

Always do configure_convert, even when the passthrough state didn't
change, for example when going from none to convert.
This commit is contained in:
Wim Taymans 2025-04-01 16:31:25 +02:00
parent 1adc9e5445
commit da69bddb95
2 changed files with 19 additions and 22 deletions

View file

@ -750,18 +750,17 @@ static int reconfigure_mode(struct impl *this, enum spa_param_port_config_mode m
this->mode = mode;
if (old_passthrough != passthrough) {
if (passthrough) {
/* add follower ports */
spa_zero(l);
spa_node_add_listener(this->follower, &l, &follower_node_events, this);
spa_hook_remove(&l);
} else {
/* add converter ports */
configure_convert(this, mode);
}
link_io(this);
if (old_passthrough != passthrough && passthrough) {
/* add follower ports */
spa_zero(l);
spa_node_add_listener(this->follower, &l, &follower_node_events, this);
spa_hook_remove(&l);
} else {
/* add converter ports */
configure_convert(this, mode);
}
link_io(this);
this->info.change_mask |= SPA_NODE_CHANGE_MASK_FLAGS | SPA_NODE_CHANGE_MASK_PARAMS;
SPA_FLAG_CLEAR(this->info.flags, SPA_NODE_FLAG_NEED_CONFIGURE);
SPA_FLAG_UPDATE(this->info.flags, SPA_NODE_FLAG_ASYNC,

View file

@ -757,18 +757,16 @@ static int reconfigure_mode(struct impl *this, enum spa_param_port_config_mode m
this->mode = mode;
if (old_passthrough != passthrough) {
if (passthrough) {
/* add follower ports */
spa_zero(l);
spa_node_add_listener(this->follower, &l, &follower_node_events, this);
spa_hook_remove(&l);
} else {
/* add converter ports */
configure_convert(this, mode);
}
link_io(this);
if (old_passthrough != passthrough && passthrough) {
/* add follower ports */
spa_zero(l);
spa_node_add_listener(this->follower, &l, &follower_node_events, this);
spa_hook_remove(&l);
} else {
configure_convert(this, mode);
}
link_io(this);
this->info.change_mask |= SPA_NODE_CHANGE_MASK_FLAGS | SPA_NODE_CHANGE_MASK_PARAMS;
SPA_FLAG_CLEAR(this->info.flags, SPA_NODE_FLAG_NEED_CONFIGURE);
SPA_FLAG_UPDATE(this->info.flags, SPA_NODE_FLAG_ASYNC,