diff --git a/spa/include/spa/node/node.h b/spa/include/spa/node/node.h index 51313c88f..de390e5ca 100644 --- a/spa/include/spa/node/node.h +++ b/spa/include/spa/node/node.h @@ -65,6 +65,8 @@ struct spa_node_info { * PortConfig parameter */ #define SPA_NODE_FLAG_OUT_PORT_CONFIG (1u<<4) /**< output ports can be reconfigured with * PortConfig parameter */ +#define SPA_NODE_FLAG_NEED_CONFIGURE (1u<<5) /**< node needs configuration before it can + * be started. */ uint64_t flags; struct spa_dict *props; /**< extra node properties */ struct spa_param_info *params; /**< parameter information */ diff --git a/spa/plugins/audioconvert/audioadapter.c b/spa/plugins/audioconvert/audioadapter.c index 1163d17fb..002982fe0 100644 --- a/spa/plugins/audioconvert/audioadapter.c +++ b/spa/plugins/audioconvert/audioadapter.c @@ -1058,8 +1058,13 @@ impl_init(const struct spa_handle_factory *factory, this->convert = iface; this->target = this->convert; - this->info_all = SPA_NODE_CHANGE_MASK_PARAMS; + this->info_all = SPA_NODE_CHANGE_MASK_FLAGS | + SPA_NODE_CHANGE_MASK_PARAMS; this->info = SPA_NODE_INFO_INIT(); + this->info.flags = SPA_NODE_FLAG_RT | + SPA_NODE_FLAG_IN_PORT_CONFIG | + SPA_NODE_FLAG_OUT_PORT_CONFIG | + SPA_NODE_FLAG_NEED_CONFIGURE; this->params[0] = SPA_PARAM_INFO(SPA_PARAM_EnumFormat, SPA_PARAM_INFO_READ); this->params[1] = SPA_PARAM_INFO(SPA_PARAM_PropInfo, SPA_PARAM_INFO_READ); this->params[2] = SPA_PARAM_INFO(SPA_PARAM_Props, SPA_PARAM_INFO_READWRITE); diff --git a/spa/plugins/audioconvert/audioconvert.c b/spa/plugins/audioconvert/audioconvert.c index 08a6c03e8..a0605cd6e 100644 --- a/spa/plugins/audioconvert/audioconvert.c +++ b/spa/plugins/audioconvert/audioconvert.c @@ -688,6 +688,9 @@ static int reconfigure_mode(struct impl *this, enum spa_param_port_config_mode m res = spa_node_set_param(this->fmt[direction], SPA_PARAM_PortConfig, 0, param); if (res < 0) return res; + + this->info.change_mask |= SPA_NODE_CHANGE_MASK_FLAGS; + this->info.flags &= ~SPA_NODE_FLAG_NEED_CONFIGURE; } /* notify ports of new node */ @@ -702,6 +705,8 @@ static int reconfigure_mode(struct impl *this, enum spa_param_port_config_mode m this); this->have_fmt_listener[direction] = true; } + emit_node_info(this, false); + return 0; } @@ -1213,7 +1218,8 @@ impl_init(const struct spa_handle_factory *factory, this->info.max_output_ports = 128; this->info.flags = SPA_NODE_FLAG_RT | SPA_NODE_FLAG_IN_PORT_CONFIG | - SPA_NODE_FLAG_OUT_PORT_CONFIG; + SPA_NODE_FLAG_OUT_PORT_CONFIG | + SPA_NODE_FLAG_NEED_CONFIGURE; this->params[0] = SPA_PARAM_INFO(SPA_PARAM_EnumPortConfig, SPA_PARAM_INFO_READ); this->params[1] = SPA_PARAM_INFO(SPA_PARAM_PortConfig, SPA_PARAM_INFO_READWRITE); this->params[2] = SPA_PARAM_INFO(SPA_PARAM_PropInfo, SPA_PARAM_INFO_READ); diff --git a/src/pipewire/context.c b/src/pipewire/context.c index a1c6412e3..b1d744615 100644 --- a/src/pipewire/context.c +++ b/src/pipewire/context.c @@ -790,7 +790,7 @@ error: static int ensure_state(struct pw_impl_node *node, bool running) { enum pw_node_state state = node->info.state; - if (node->active && running) + if (node->active && !SPA_FLAG_IS_SET(node->spa_flags, SPA_NODE_FLAG_NEED_CONFIGURE) && running) state = PW_NODE_STATE_RUNNING; else if (state > PW_NODE_STATE_IDLE) state = PW_NODE_STATE_IDLE;