latency: fix latency combine calculations

0 is a valid min latency so we can't use it as an unset value. Use
some large value instead and when nothing was configured, assume it
is 0.

Fixes #1839
This commit is contained in:
Wim Taymans 2021-12-02 14:49:48 +01:00
parent 401e56699d
commit 97cad7284a
4 changed files with 32 additions and 7 deletions

View file

@ -1926,11 +1926,14 @@ static void default_latency(struct client *c, enum spa_direction direction,
enum spa_direction other;
struct port *p;
*latency = SPA_LATENCY_INFO(direction);
other = SPA_DIRECTION_REVERSE(direction);
spa_latency_info_combine_start(latency, direction);
spa_list_for_each(p, &c->ports[other], link)
spa_latency_info_combine(latency, &p->object->port.latency[direction]);
spa_latency_info_combine_finish(latency);
}
/* called from thread-loop */