adapter: only clear the NEED_CONFIGURE flag when mode != none

As long as we are in the 'none' PortConfig mode, we set the NEED_CONFIGURE
flag.

This fixes early start in audioadpter nodes because PortConfig is set to
none at init time and this used to clear the NEED_CONFIGURE flag, which
would start the node before the session manager could to a PortConfig
and cause a -22 error.
This commit is contained in:
Wim Taymans 2025-05-27 15:38:51 +02:00
parent 548fa0ec48
commit e126f9bcbf
2 changed files with 5 additions and 4 deletions

View file

@ -778,7 +778,8 @@ static int reconfigure_mode(struct impl *this, enum spa_param_port_config_mode m
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_NEED_CONFIGURE,
this->mode == SPA_PARAM_PORT_CONFIG_MODE_none);
SPA_FLAG_UPDATE(this->info.flags, SPA_NODE_FLAG_ASYNC,
this->async && this->follower == this->target);
this->params[IDX_Props].user++;
@ -2045,8 +2046,7 @@ impl_init(const struct spa_handle_factory *factory,
SPA_NODE_CHANGE_MASK_PARAMS;
this->info = SPA_NODE_INFO_INIT();
this->info.flags = SPA_NODE_FLAG_RT |
0;
//SPA_NODE_FLAG_NEED_CONFIGURE;
SPA_NODE_FLAG_NEED_CONFIGURE;
this->params[IDX_EnumFormat] = SPA_PARAM_INFO(SPA_PARAM_EnumFormat, SPA_PARAM_INFO_READ);
this->params[IDX_PropInfo] = SPA_PARAM_INFO(SPA_PARAM_PropInfo, SPA_PARAM_INFO_READ);
this->params[IDX_Props] = SPA_PARAM_INFO(SPA_PARAM_Props, SPA_PARAM_INFO_READWRITE);