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

Unified Diff: webrtc/voice_engine/channel.cc

Issue 1986093002: Propagate muted info from VoE Channel to AudioConferenceMixer (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@mixer-mod-3
Patch Set: Created 4 years, 7 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
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);

Powered by Google App Engine
This is Rietveld 408576698