From 6b6d08164f8ca5da8afa4a9d4c680cb51bb317d4 Mon Sep 17 00:00:00 2001 From: "punyabrata@webrtc.org" Date: Wed, 28 Sep 2011 17:45:03 +0000 Subject: [PATCH] Remove assert "currentVoEMicLevel <= kMaxVolumeLevel". We ran into an issue on a Linux system where the currentVoEMicLevel was in fact greater than the kMaxVolumeLevel. Therefore we are removing this assert and capping the currentMicLevel to the maxVolumeLevel when this case is detected. Review URL: http://webrtc-codereview.appspot.com/180001 git-svn-id: http://webrtc.googlecode.com/svn/trunk@661 4adac7df-926f-26a2-2b94-8c16560cd09d --- src/voice_engine/main/source/voe_base_impl.cc | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/voice_engine/main/source/voe_base_impl.cc b/src/voice_engine/main/source/voe_base_impl.cc index edaea3dc57..2991df815f 100644 --- a/src/voice_engine/main/source/voe_base_impl.cc +++ b/src/voice_engine/main/source/voe_base_impl.cc @@ -199,7 +199,15 @@ WebRtc_Word32 VoEBaseImpl::RecordedDataIsAvailable( / (maxVolume)); } } - assert(currentVoEMicLevel <= kMaxVolumeLevel); + // We learned that on certain systems (e.g Linux) the currentVoEMicLevel + // can be greater than the maxVolumeLevel therefore + // we are going to cap the currentVoEMicLevel to the maxVolumeLevel + // if it turns out that the currentVoEMicLevel is indeed greater + // than the maxVolumeLevel + if (currentVoEMicLevel > kMaxVolumeLevel) + { + currentVoEMicLevel = kMaxVolumeLevel; + } } // Keep track if the MicLevel has been changed by the AGC, if not,