diff options
author | andrew@webrtc.org <andrew@webrtc.org@4adac7df-926f-26a2-2b94-8c16560cd09d> | 2014-01-11 01:25:53 +0000 |
---|---|---|
committer | andrew@webrtc.org <andrew@webrtc.org@4adac7df-926f-26a2-2b94-8c16560cd09d> | 2014-01-11 01:25:53 +0000 |
commit | 22470b5ee6298ed0fe8209563758ec171a1c4397 (patch) | |
tree | 31bfc5b24d910eb27d98d699448bba9e5bfd9e31 /voice_engine/transmit_mixer.cc | |
parent | f3a2ef39a9ba3d382916bcfb67c952781ab91df3 (diff) | |
download | webrtc-22470b5ee6298ed0fe8209563758ec171a1c4397.tar.gz |
Minor voice engine improvements around AGC.
- Remove one unneeded lock in CaptureLevel(), as the call to this
method should always come on the same thread as PrepareDemux().
- Remove check on analog AGC before doing volume calculations. Saves a
bit of code. Instead check if the incoming volume is set to zero, which
is a potentially common occurrence as it indicates no volume is
available.
R=aluebs@webrtc.org, xians@webrtc.org
Review URL: https://webrtc-codereview.appspot.com/6859004
git-svn-id: http://webrtc.googlecode.com/svn/trunk/webrtc@5366 4adac7df-926f-26a2-2b94-8c16560cd09d
Diffstat (limited to 'voice_engine/transmit_mixer.cc')
-rw-r--r-- | voice_engine/transmit_mixer.cc | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/voice_engine/transmit_mixer.cc b/voice_engine/transmit_mixer.cc index b9618c81..e8b3365b 100644 --- a/voice_engine/transmit_mixer.cc +++ b/voice_engine/transmit_mixer.cc @@ -494,7 +494,6 @@ void TransmitMixer::EncodeAndSend(const int voe_channels[], uint32_t TransmitMixer::CaptureLevel() const { - CriticalSectionScoped cs(&_critSect); return _captureLevel; } @@ -1341,11 +1340,10 @@ void TransmitMixer::ProcessAudio(int delay_ms, int clock_drift, assert(false); } - CriticalSectionScoped cs(&_critSect); - // Store new capture level. Only updated when analog AGC is enabled. _captureLevel = agc->stream_analog_level(); + CriticalSectionScoped cs(&_critSect); // Triggers a callback in OnPeriodicProcess(). _saturationWarning |= agc->stream_is_saturated(); } |