audioconvert: ignore latency param on monitor ports

Ignore latency params on the monitor ports of merger. They interfere
with the latency reporting set by the adapter.
The adapter will set the latency param from the follower on port 0 in
the converter, so pass this on to the merger as the latency and ignore
all other updates.

Fixes a case where the latency of a sink would become 0 when a monitor
port was recorded from.
This commit is contained in:
Wim Taymans 2022-01-11 17:52:41 +01:00
parent b7279a1728
commit 3666c4810e
2 changed files with 11 additions and 6 deletions

View file

@ -1112,11 +1112,12 @@ impl_node_port_set_param(void *object,
switch (id) { switch (id) {
case SPA_PARAM_Latency: case SPA_PARAM_Latency:
target = this->fmt[SPA_DIRECTION_REVERSE(direction)]; if (port_id == 0) {
port_id = 0; target = this->fmt[SPA_DIRECTION_REVERSE(direction)];
if ((res = spa_node_port_set_param(target, if ((res = spa_node_port_set_param(target,
direction, port_id, id, flags, param)) < 0) direction, port_id, id, flags, param)) < 0)
return res; return res;
}
break; break;
} }

View file

@ -1031,7 +1031,11 @@ static int port_set_latency(void *object,
enum spa_direction other = SPA_DIRECTION_REVERSE(direction); enum spa_direction other = SPA_DIRECTION_REVERSE(direction);
uint32_t i; uint32_t i;
spa_log_debug(this->log, "%p: set latency direction:%d", this, direction); spa_log_debug(this->log, "%p: set latency direction:%d id:%d",
this, direction, port_id);
if (direction == SPA_DIRECTION_OUTPUT && port_id != 0)
return 0;
if (latency == NULL) { if (latency == NULL) {
this->latency[other] = SPA_LATENCY_INFO(other); this->latency[other] = SPA_LATENCY_INFO(other);