RTP: Fix non-zero DC in EchoSuppressor caused while aggregating samples.
Rewrite using integer arithmetic to get full 32-bit precision instead
of 23-bit in single precision floating-points.
Bug: 3029745
Change-Id: If67dcc403923755f403d08bbafb41ebce26e4e8b
diff --git a/voip/jni/rtp/AudioGroup.cpp b/voip/jni/rtp/AudioGroup.cpp
index 9da560a..0c8a725 100644
--- a/voip/jni/rtp/AudioGroup.cpp
+++ b/voip/jni/rtp/AudioGroup.cpp
@@ -768,7 +768,7 @@
LOGD("latency: output %d, input %d", track.latency(), record.latency());
// Initialize echo canceler.
- EchoSuppressor echo(sampleRate, sampleCount, sampleCount * 2 +
+ EchoSuppressor echo(sampleCount,
(track.latency() + record.latency()) * sampleRate / 1000);
// Give device socket a reasonable buffer size.