From 7c223a6565551cb18ef9db8930b0ce4eced7336c Mon Sep 17 00:00:00 2001 From: "Alexander E. Patrakov" Date: Sun, 22 Feb 2015 16:39:14 +0500 Subject: [PATCH] echo-cancel: fix the obviously-wrong "buffer+=buffer" logic Same bug as in module-loopback, pointed out by Georg Chini in a private email. Signed-off-by: Alexander E. Patrakov --- src/modules/echo-cancel/module-echo-cancel.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/echo-cancel/module-echo-cancel.c b/src/modules/echo-cancel/module-echo-cancel.c index b95a965..639cd41 100644 --- a/src/modules/echo-cancel/module-echo-cancel.c +++ b/src/modules/echo-cancel/module-echo-cancel.c @@ -315,7 +315,7 @@ static int64_t calc_diff(struct userdata *u, struct snapshot *snapshot) { if (recv_counter <= send_counter) buffer_latency += (int64_t) (send_counter - recv_counter); else - buffer_latency += PA_CLIP_SUB(buffer_latency, (int64_t) (recv_counter - send_counter)); + buffer_latency = PA_CLIP_SUB(buffer_latency, (int64_t) (recv_counter - send_counter)); /* capture and playback are perfectly aligned when diff_time is 0 */ diff_time = (snapshot->sink_now + snapshot->sink_latency - buffer_latency) - -- 2.7.4