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