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

Unified Diff: webrtc/modules/audio_coding/acm2/audio_coding_module_unittest.cc

Issue 2750783004: Add mute state field to AudioFrame. (Closed)
Patch Set: don't return from Add() too early Created 3 years, 9 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 c7bbfb0434428a75dd6c63462b94d230e89212c4..13c8869542f438a2067a2e44e9bfb9b6a2a1ed99 100644
--- a/webrtc/modules/audio_coding/acm2/audio_coding_module_unittest.cc
+++ b/webrtc/modules/audio_coding/acm2/audio_coding_module_unittest.cc
@@ -173,9 +173,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_));
@@ -696,7 +694,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