Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(574)

Unified Diff: webrtc/voice_engine/audio_level.cc

Issue 2750783004: Add mute state field to AudioFrame. (Closed)
Patch Set: Update new usages of AudioFrame::data_ Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webrtc/voice_engine/BUILD.gn ('k') | webrtc/voice_engine/channel.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/voice_engine/audio_level.cc
diff --git a/webrtc/voice_engine/audio_level.cc b/webrtc/voice_engine/audio_level.cc
index b2f4df4da83d0a7a14729b582cf400210f37c124..27a7dde1b2b25c2faefa1aa6a8d6641c07776d37 100644
--- a/webrtc/voice_engine/audio_level.cc
+++ b/webrtc/voice_engine/audio_level.cc
@@ -50,9 +50,10 @@ void AudioLevel::Clear() {
void AudioLevel::ComputeLevel(const AudioFrame& audioFrame) {
// Check speech level (works for 2 channels as well)
- int16_t abs_value = WebRtcSpl_MaxAbsValueW16(
- audioFrame.data_,
- audioFrame.samples_per_channel_ * audioFrame.num_channels_);
+ int16_t abs_value = audioFrame.muted() ? 0 :
+ WebRtcSpl_MaxAbsValueW16(
+ audioFrame.data(),
+ audioFrame.samples_per_channel_ * audioFrame.num_channels_);
// Protect member access using a lock since this method is called on a
// dedicated audio thread in the RecordedDataIsAvailable() callback.
« no previous file with comments | « webrtc/voice_engine/BUILD.gn ('k') | webrtc/voice_engine/channel.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698