diff --git a/spa/plugins/audioconvert/audioconvert.c b/spa/plugins/audioconvert/audioconvert.c index 49e7fee13..bbf547970 100644 --- a/spa/plugins/audioconvert/audioconvert.c +++ b/spa/plugins/audioconvert/audioconvert.c @@ -729,13 +729,20 @@ static int reconfigure_mode(struct impl *this, enum spa_param_port_config_mode m spa_pod_builder_init(&b, buffer, sizeof(buffer)); param = spa_format_audio_raw_build(&b, SPA_PARAM_Format, &info->info.raw); - param = spa_pod_builder_add_object(&b, - SPA_TYPE_OBJECT_ParamPortConfig, SPA_PARAM_PortConfig, - SPA_PARAM_PORT_CONFIG_direction, SPA_POD_Id(direction), - SPA_PARAM_PORT_CONFIG_mode, SPA_POD_Id(SPA_PARAM_PORT_CONFIG_MODE_dsp), - SPA_PARAM_PORT_CONFIG_monitor, SPA_POD_Bool(monitor), - SPA_PARAM_PORT_CONFIG_format, SPA_POD_Pod(param)); - res = spa_node_set_param(this->fmt[direction], SPA_PARAM_PortConfig, 0, param); + + if (mode == SPA_PARAM_PORT_CONFIG_MODE_dsp) { + param = spa_pod_builder_add_object(&b, + SPA_TYPE_OBJECT_ParamPortConfig, SPA_PARAM_PortConfig, + SPA_PARAM_PORT_CONFIG_direction, SPA_POD_Id(direction), + SPA_PARAM_PORT_CONFIG_mode, SPA_POD_Id(SPA_PARAM_PORT_CONFIG_MODE_dsp), + SPA_PARAM_PORT_CONFIG_monitor, SPA_POD_Bool(monitor), + SPA_PARAM_PORT_CONFIG_format, SPA_POD_Pod(param)); + res = spa_node_set_param(this->fmt[direction], SPA_PARAM_PortConfig, 0, param); + } else { + res = spa_node_port_set_param(this->fmt[direction], direction, 0, + SPA_PARAM_Format, 0, param); + } + if (res < 0) return res; diff --git a/spa/plugins/audioconvert/fmtconvert.c b/spa/plugins/audioconvert/fmtconvert.c index 34935535b..3ab852df2 100644 --- a/spa/plugins/audioconvert/fmtconvert.c +++ b/spa/plugins/audioconvert/fmtconvert.c @@ -696,6 +696,7 @@ static int port_set_format(void *object, port->params[PORT_Format] = SPA_PARAM_INFO(SPA_PARAM_Format, SPA_PARAM_INFO_WRITE); port->params[PORT_Buffers] = SPA_PARAM_INFO(SPA_PARAM_Buffers, 0); } + port->info.change_mask |= SPA_PORT_CHANGE_MASK_PARAMS; emit_port_info(this, port, false); return 0; } @@ -1029,7 +1030,8 @@ static int init_port(struct impl *this, enum spa_direction direction, uint32_t p port->id = port_id; spa_list_init(&port->queue); - port->info_all = SPA_PORT_CHANGE_MASK_FLAGS; + port->info_all = SPA_PORT_CHANGE_MASK_FLAGS | + SPA_PORT_CHANGE_MASK_PARAMS; port->info = SPA_PORT_INFO_INIT(); port->info.flags = SPA_PORT_FLAG_NO_REF | SPA_PORT_FLAG_DYNAMIC_DATA;