audioconvert: don't overwrite port

Make a new variable to iterate the other ports so that we can use the
original port to emit notifications.

Fixes Latency and other params set on DSP ports.
This commit is contained in:
Wim Taymans 2022-11-18 13:21:14 +01:00
parent 43d02410e6
commit bb558b7d95
2 changed files with 17 additions and 15 deletions

View file

@ -897,12 +897,13 @@ static void convert_node_info(void *data, const struct spa_node_info *info)
(this->params[idx].flags & SPA_PARAM_INFO_SERIAL) |
(info->params[i].flags & SPA_PARAM_INFO_READWRITE);
if (!this->add_listener) {
if (this->add_listener)
continue;
this->params[idx].user++;
spa_log_debug(this->log, "param %d changed", info->params[i].id);
}
}
}
emit_node_info(this, false);
}
@ -1005,12 +1006,13 @@ static void follower_info(void *data, const struct spa_node_info *info)
(this->params[idx].flags & SPA_PARAM_INFO_SERIAL) |
(info->params[i].flags & SPA_PARAM_INFO_READWRITE);
if (!this->add_listener) {
if (this->add_listener)
continue;
this->params[idx].user++;
spa_log_debug(this->log, "param %d changed", info->params[i].id);
}
}
}
emit_node_info(this, false);
spa_zero(this->info.props);
@ -1085,17 +1087,17 @@ static void follower_port_info(void *data,
default:
continue;
}
if (!this->add_listener &&
this->follower_params_flags[idx] == info->params[i].flags)
continue;
this->info.change_mask |= SPA_NODE_CHANGE_MASK_PARAMS;
this->follower_params_flags[idx] = info->params[i].flags;
this->params[idx].flags =
(this->params[idx].flags & SPA_PARAM_INFO_SERIAL) |
(info->params[i].flags & SPA_PARAM_INFO_READWRITE);
this->info.change_mask |= SPA_NODE_CHANGE_MASK_PARAMS;
if (this->add_listener)
continue;

View file

@ -1869,7 +1869,7 @@ static int port_set_latency(void *object,
const struct spa_pod *latency)
{
struct impl *this = object;
struct port *port;
struct port *port, *oport;
enum spa_direction other = SPA_DIRECTION_REVERSE(direction);
uint32_t i;
@ -1891,10 +1891,10 @@ static int port_set_latency(void *object,
}
for (i = 0; i < this->dir[other].n_ports; i++) {
port = GET_PORT(this, other, i);
port->info.change_mask |= SPA_PORT_CHANGE_MASK_PARAMS;
port->params[IDX_Latency].user++;
emit_port_info(this, port, false);
oport = GET_PORT(this, other, i);
oport->info.change_mask |= SPA_PORT_CHANGE_MASK_PARAMS;
oport->params[IDX_Latency].user++;
emit_port_info(this, oport, false);
}
port->info.change_mask |= SPA_PORT_CHANGE_MASK_PARAMS;
port->params[IDX_Latency].user++;