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:
Peter Meerwald 2013-04-22 15:36:12 +02:00 committed by Arun Raghavan
parent 9e4229cfe0
commit 8bca464394

View file

@ -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