From e126f9bcbf5ca27df3410343a6dea658463dd3e2 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Tue, 27 May 2025 15:38:51 +0200 Subject: [PATCH] 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. --- spa/plugins/audioconvert/audioadapter.c | 3 ++- spa/plugins/videoconvert/videoadapter.c | 6 +++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/spa/plugins/audioconvert/audioadapter.c b/spa/plugins/audioconvert/audioadapter.c index 927b0ddcc..e9595aa1d 100644 --- a/spa/plugins/audioconvert/audioadapter.c +++ b/spa/plugins/audioconvert/audioadapter.c @@ -770,7 +770,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++; diff --git a/spa/plugins/videoconvert/videoadapter.c b/spa/plugins/videoconvert/videoadapter.c index eefd7e3f9..9eae268e1 100644 --- a/spa/plugins/videoconvert/videoadapter.c +++ b/spa/plugins/videoconvert/videoadapter.c @@ -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);