mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-03 09:01:50 -05:00
echo-cancel: Fix send/recv_counter in calc_diff()
send_counter/recv_counter relate to the bytes (play stream) passed through the queue, hence the same sample spec must be used Signed-off-by: Peter Meerwald <p.meerwald@bct-electronic.com> Acked-by: Stefan Huber <shuber@sthu.org>
This commit is contained in:
parent
9e4229cfe0
commit
8bca464394
1 changed files with 2 additions and 2 deletions
|
|
@ -312,8 +312,8 @@ static int64_t calc_diff(struct userdata *u, struct snapshot *snapshot) {
|
|||
buffer_latency += source_delay + sink_delay;
|
||||
|
||||
/* add the latency difference due to samples not yet transferred */
|
||||
send_counter = pa_bytes_to_usec(snapshot->send_counter, &u->sink_input->sample_spec);
|
||||
recv_counter = pa_bytes_to_usec(snapshot->recv_counter, &u->source_output->sample_spec);
|
||||
send_counter = pa_bytes_to_usec(snapshot->send_counter, &u->sink->sample_spec);
|
||||
recv_counter = pa_bytes_to_usec(snapshot->recv_counter, &u->sink->sample_spec);
|
||||
if (recv_counter <= send_counter)
|
||||
buffer_latency += (int64_t) (send_counter - recv_counter);
|
||||
else
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue