[pulseaudio-discuss] [PATCH] echo-cancel: Fix send/recv_counter in calc_diff()

Arun Raghavan arun.raghavan at collabora.co.uk
Sun May 12 22:37:50 PDT 2013


On Mon, 2013-04-22 at 15:36 +0200, Peter Meerwald wrote:
> From: Peter Meerwald <p.meerwald at bct-electronic.com>
> 
> 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 at bct-electronic.com>
> Acked-by: Stefan Huber <shuber at sthu.org>
> ---
>  src/modules/echo-cancel/module-echo-cancel.c |    4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/src/modules/echo-cancel/module-echo-cancel.c b/src/modules/echo-cancel/module-echo-cancel.c
> index 53c81ff..9f7b5f9 100644
> --- a/src/modules/echo-cancel/module-echo-cancel.c
> +++ b/src/modules/echo-cancel/module-echo-cancel.c
> @@ -334,8 +334,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

Looks good. Pushed to master and next.

-- Arun



More information about the pulseaudio-discuss mailing list