[pulseaudio-discuss] [PATCH] echo-cancel: fix the obviously-wrong "buffer+=buffer" logic

Alexander E. Patrakov patrakov at gmail.com
Sun Feb 22 03:39:14 PST 2015


Same bug as in module-loopback, pointed out by Georg Chini in a private
email.

Signed-off-by: Alexander E. Patrakov <patrakov at gmail.com>
---
 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.2.1



More information about the pulseaudio-discuss mailing list