Index: webrtc/modules/audio_processing/agc/legacy/analog_agc.c |
diff --git a/webrtc/modules/audio_processing/agc/legacy/analog_agc.c b/webrtc/modules/audio_processing/agc/legacy/analog_agc.c |
index 36c67c282a02a1b9096f01aa8bda572624f8b67b..030077afe30aae60d2a611670cbaf0a0323e3015 100644 |
--- a/webrtc/modules/audio_processing/agc/legacy/analog_agc.c |
+++ b/webrtc/modules/audio_processing/agc/legacy/analog_agc.c |
@@ -476,16 +476,20 @@ void WebRtcAgc_ZeroCtrl(LegacyAgc* stt, int32_t* inMicLevel, int32_t* env) { |
int16_t i; |
int32_t tmp32 = 0; |
int32_t midVal; |
+ const int kZeroThreshold = 500; |
/* Is the input signal zero? */ |
for (i = 0; i < 10; i++) { |
+ if (env[i] >= kZeroThreshold || tmp32 >= kZeroThreshold) { |
peah-webrtc
2016/06/03 05:10:35
What happened to the int64 sum variant?
|
+ break; |
+ } |
tmp32 += env[i]; |
} |
/* Each block is allowed to have a few non-zero |
* samples. |
*/ |
- if (tmp32 < 500) { |
+ if (i == 10 && tmp32 < kZeroThreshold) { |
stt->msZero += 10; |
} else { |
stt->msZero = 0; |