Index: webrtc/voice_engine/channel.cc |
diff --git a/webrtc/voice_engine/channel.cc b/webrtc/voice_engine/channel.cc |
index 339a6a52ff8c6d9c1e3ffd4c3f2ed0a3bcce30be..91af34016b3ee80d1073a2472c17d8c61f4e230d 100644 |
--- a/webrtc/voice_engine/channel.cc |
+++ b/webrtc/voice_engine/channel.cc |
@@ -476,16 +476,28 @@ bool Channel::OnRecoveredPacket(const uint8_t* rtp_packet, |
return ReceivePacket(rtp_packet, rtp_packet_length, header, false); |
} |
-int32_t Channel::GetAudioFrame(int32_t id, AudioFrame* audioFrame) { |
+int32_t Channel::GetAudioFrame(int32_t id, |
+ AudioFrame* audioFrame) { |
+ bool muted; |
+ int32_t ret = GetAudioFrameWithMuted(id, audioFrame, &muted); |
+ if (muted) { |
+ // Explicitly set all samples to zero when the |muted| flag was set true. |
+ audioFrame->Mute(); |
+ } |
+ return ret; |
+} |
+ |
+int32_t Channel::GetAudioFrameWithMuted(int32_t id, |
+ AudioFrame* audioFrame, |
+ bool* muted) { |
if (event_log_) { |
unsigned int ssrc; |
RTC_CHECK_EQ(GetLocalSSRC(ssrc), 0); |
event_log_->LogAudioPlayout(ssrc); |
} |
// Get 10ms raw PCM data from the ACM (mixer limits output frequency) |
- bool muted; |
if (audio_coding_->PlayoutData10Ms(audioFrame->sample_rate_hz_, audioFrame, |
- &muted) == -1) { |
+ muted) == -1) { |
WEBRTC_TRACE(kTraceError, kTraceVoice, VoEId(_instanceId, _channelId), |
"Channel::GetAudioFrame() PlayoutData10Ms() failed!"); |
// In all likelihood, the audio in this frame is garbage. We return an |
@@ -494,7 +506,7 @@ int32_t Channel::GetAudioFrame(int32_t id, AudioFrame* audioFrame) { |
// irrelevant. |
return -1; |
} |
- RTC_DCHECK(!muted); |
+ RTC_DCHECK(!*muted); |
if (_RxVadDetection) { |
UpdateRxVadDetection(*audioFrame); |