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

Unified Diff: webrtc/modules/audio_mixer/frame_combiner_unittest.cc

Issue 2750783004: Add mute state field to AudioFrame. (Closed)
Patch Set: Address review comments 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_mixer/frame_combiner_unittest.cc
diff --git a/webrtc/modules/audio_mixer/frame_combiner_unittest.cc b/webrtc/modules/audio_mixer/frame_combiner_unittest.cc
index 13c66012f99f27c4fd30d820e19c0166fcf3d1f6..80b2798213ec9c840f8ad829bbc12f356b3ea60d 100644
--- a/webrtc/modules/audio_mixer/frame_combiner_unittest.cc
+++ b/webrtc/modules/audio_mixer/frame_combiner_unittest.cc
@@ -95,9 +95,11 @@ TEST(FrameCombiner, CombiningZeroFramesShouldProduceSilence) {
combiner.Combine(frames_to_combine, number_of_channels, rate,
&audio_frame_for_mixing);
+ const int16_t* audio_frame_for_mixing_data =
+ audio_frame_for_mixing.data();
const std::vector<int16_t> mixed_data(
- audio_frame_for_mixing.data_,
- audio_frame_for_mixing.data_ + number_of_channels * rate / 100);
+ audio_frame_for_mixing_data,
+ audio_frame_for_mixing_data + number_of_channels * rate / 100);
const std::vector<int16_t> expected(number_of_channels * rate / 100, 0);
EXPECT_EQ(mixed_data, expected);
@@ -112,15 +114,17 @@ TEST(FrameCombiner, CombiningOneFrameShouldNotChangeFrame) {
SCOPED_TRACE(ProduceDebugText(rate, number_of_channels, 1));
SetUpFrames(rate, number_of_channels);
- std::iota(frame1.data_, frame1.data_ + number_of_channels * rate / 100,
- 0);
+ int16_t* frame1_data = frame1.mutable_data();
+ std::iota(frame1_data, frame1_data + number_of_channels * rate / 100, 0);
const std::vector<AudioFrame*> frames_to_combine = {&frame1};
combiner.Combine(frames_to_combine, number_of_channels, rate,
&audio_frame_for_mixing);
+ const int16_t* audio_frame_for_mixing_data =
+ audio_frame_for_mixing.data();
const std::vector<int16_t> mixed_data(
- audio_frame_for_mixing.data_,
- audio_frame_for_mixing.data_ + number_of_channels * rate / 100);
+ audio_frame_for_mixing_data,
+ audio_frame_for_mixing_data + number_of_channels * rate / 100);
std::vector<int16_t> expected(number_of_channels * rate / 100);
std::iota(expected.begin(), expected.end(), 0);

Powered by Google App Engine
This is Rietveld 408576698