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

Unified Diff: webrtc/modules/audio_coding/acm2/audio_coding_module_unittest.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/acm2/audio_coding_module_unittest.cc
diff --git a/webrtc/modules/audio_coding/acm2/audio_coding_module_unittest.cc b/webrtc/modules/audio_coding/acm2/audio_coding_module_unittest.cc
index e8a6c398e2a3354d26578d1a00a356bf0ebf669d..5b9ec99b86035e9f12492df322477783f7659981 100644
--- a/webrtc/modules/audio_coding/acm2/audio_coding_module_unittest.cc
+++ b/webrtc/modules/audio_coding/acm2/audio_coding_module_unittest.cc
@@ -175,9 +175,7 @@ class AudioCodingModuleTestOldApi : public ::testing::Test {
input_frame_.samples_per_channel_ = kSampleRateHz * 10 / 1000; // 10 ms.
static_assert(kSampleRateHz * 10 / 1000 <= AudioFrame::kMaxDataSizeSamples,
"audio frame too small");
- memset(input_frame_.data_,
- 0,
- input_frame_.samples_per_channel_ * sizeof(input_frame_.data_[0]));
+ input_frame_.Mute();
ASSERT_EQ(0, acm_->RegisterTransportCallback(&packet_cb_));
@@ -698,7 +696,7 @@ class AcmIsacMtTestOldApi : public AudioCodingModuleMtTestOldApi {
// TODO(kwiberg): Use std::copy here. Might be complications because AFAICS
// this call confuses the number of samples with the number of bytes, and
// ends up copying only half of what it should.
- memcpy(input_frame_.data_, audio_loop_.GetNextBlock().data(),
+ memcpy(input_frame_.mutable_data(), audio_loop_.GetNextBlock().data(),
kNumSamples10ms);
AudioCodingModuleTestOldApi::InsertAudio();
}

Powered by Google App Engine
This is Rietveld 408576698