audioconvert: fix monitor port latency

The monitor port latency is the reverse direction of the input ports.
This commit is contained in:
Wim Taymans 2023-05-25 20:05:54 +02:00
parent a5b845650e
commit 09f480ccb3

View file

@ -2026,8 +2026,13 @@ impl_node_port_enum_params(void *object, int seq,
case SPA_PARAM_Latency: case SPA_PARAM_Latency:
switch (result.index) { switch (result.index) {
case 0: case 1: case 0: case 1:
param = spa_latency_build(&b, id, &this->dir[result.index].latency); {
uint32_t idx = result.index;
if (port->is_monitor)
idx = idx ^ 1;
param = spa_latency_build(&b, id, &this->dir[idx].latency);
break; break;
}
default: default:
return 0; return 0;
} }