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

Unified Diff: webrtc/modules/audio_coding/neteq/neteq_impl.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
Index: webrtc/modules/audio_coding/neteq/neteq_impl.cc
diff --git a/webrtc/modules/audio_coding/neteq/neteq_impl.cc b/webrtc/modules/audio_coding/neteq/neteq_impl.cc
index f512d75a561edf6bc9f222855f44cd8e64b31755..f9ec3bb44ea766865180894733e6c62115041596 100644
--- a/webrtc/modules/audio_coding/neteq/neteq_impl.cc
+++ b/webrtc/modules/audio_coding/neteq/neteq_impl.cc
@@ -11,7 +11,6 @@
#include "webrtc/modules/audio_coding/neteq/neteq_impl.h"
#include <assert.h>
-#include <memory.h> // memset
#include <algorithm>
#include <utility>
@@ -1063,16 +1062,17 @@ int NetEqImpl::GetAudioInternal(AudioFrame* audio_frame, bool* muted) {
<< ") != output_size_samples_ (" << output_size_samples_
<< ")";
// TODO(minyue): treatment of under-run, filling zeros
- memset(audio_frame->data_, 0, num_output_samples * sizeof(int16_t));
+ audio_frame->Mute();
return kSampleUnderrun;
}
// Should always have overlap samples left in the |sync_buffer_|.
RTC_DCHECK_GE(sync_buffer_->FutureLength(), expand_->overlap_length());
+ // TODO(yujo): For muted frames, this can be a copy rather than an addition.
if (play_dtmf) {
- return_value =
- DtmfOverdub(dtmf_event, sync_buffer_->Channels(), audio_frame->data_);
+ return_value = DtmfOverdub(dtmf_event, sync_buffer_->Channels(),
+ audio_frame->mutable_data());
}
// Update the background noise parameters if last operation wrote data

Powered by Google App Engine
This is Rietveld 408576698