mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-10-29 05:40:23 -04:00
loopback: Fix the obviously-wrong "buffer+=buffer" logic
Originally pointed out by Georg Chini. Calculating buffer = buffer + (send_counter - recv_counter) in one branch and buffer = 2 * buffer - (recv_counter - send_counter) looks very obviously wrong. In other words, before the patch, the contribution from the previous lines was double-counted.
This commit is contained in:
parent
11d22f97cf
commit
c7310f8e37
1 changed files with 1 additions and 1 deletions
|
|
@ -186,7 +186,7 @@ static void adjust_rates(struct userdata *u) {
|
||||||
if (u->latency_snapshot.recv_counter <= u->latency_snapshot.send_counter)
|
if (u->latency_snapshot.recv_counter <= u->latency_snapshot.send_counter)
|
||||||
buffer += (size_t) (u->latency_snapshot.send_counter - u->latency_snapshot.recv_counter);
|
buffer += (size_t) (u->latency_snapshot.send_counter - u->latency_snapshot.recv_counter);
|
||||||
else
|
else
|
||||||
buffer += PA_CLIP_SUB(buffer, (size_t) (u->latency_snapshot.recv_counter - u->latency_snapshot.send_counter));
|
buffer = PA_CLIP_SUB(buffer, (size_t) (u->latency_snapshot.recv_counter - u->latency_snapshot.send_counter));
|
||||||
|
|
||||||
buffer_latency = pa_bytes_to_usec(buffer, &u->sink_input->sample_spec);
|
buffer_latency = pa_bytes_to_usec(buffer, &u->sink_input->sample_spec);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue