mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-06 13:30:01 -05:00
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:
parent
401e56699d
commit
97cad7284a
4 changed files with 32 additions and 7 deletions
|
|
@ -769,13 +769,13 @@ static int default_latency(struct filter *impl, struct port *port, enum spa_dire
|
|||
struct spa_latency_info info;
|
||||
struct port *p;
|
||||
|
||||
info = SPA_LATENCY_INFO(direction);
|
||||
|
||||
spa_latency_info_combine_start(&info, direction);
|
||||
spa_list_for_each(p, &impl->port_list, link) {
|
||||
if (p->direction == direction)
|
||||
continue;
|
||||
spa_latency_info_combine(&info, &p->latency[direction]);
|
||||
}
|
||||
spa_latency_info_combine_finish(&info);
|
||||
|
||||
spa_process_latency_info_add(&impl->process_latency, &info);
|
||||
|
||||
|
|
|
|||
|
|
@ -1318,7 +1318,7 @@ int pw_impl_port_recalc_latency(struct pw_impl_port *port)
|
|||
if (port->destroying)
|
||||
return 0;
|
||||
|
||||
latency = SPA_LATENCY_INFO(SPA_DIRECTION_REVERSE(port->direction));
|
||||
spa_latency_info_combine_start(&latency, SPA_DIRECTION_REVERSE(port->direction));
|
||||
|
||||
if (port->direction == PW_DIRECTION_OUTPUT) {
|
||||
spa_list_for_each(l, &port->links, output_link) {
|
||||
|
|
@ -1341,6 +1341,7 @@ int pw_impl_port_recalc_latency(struct pw_impl_port *port)
|
|||
latency.min_ns, latency.max_ns);
|
||||
}
|
||||
}
|
||||
spa_latency_info_combine_finish(&latency);
|
||||
|
||||
current = &port->latency[latency.direction];
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue