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

Unified Diff: webrtc/modules/audio_mixer/audio_frame_manipulator_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_mixer/audio_frame_manipulator_unittest.cc
diff --git a/webrtc/modules/audio_mixer/audio_frame_manipulator_unittest.cc b/webrtc/modules/audio_mixer/audio_frame_manipulator_unittest.cc
index 26258a28dc54e521868c08a71003aca0b461d3c3..e163d0f0ca51c833bfbd361b81ecd0ec1bf25b4f 100644
--- a/webrtc/modules/audio_mixer/audio_frame_manipulator_unittest.cc
+++ b/webrtc/modules/audio_mixer/audio_frame_manipulator_unittest.cc
@@ -23,8 +23,9 @@ void FillFrameWithConstants(size_t samples_per_channel,
AudioFrame* frame) {
frame->num_channels_ = number_of_channels;
frame->samples_per_channel_ = samples_per_channel;
- std::fill(frame->data_,
- frame->data_ + samples_per_channel * number_of_channels, value);
+ int16_t* frame_data = frame->mutable_data();
+ std::fill(frame_data,
+ frame_data + samples_per_channel * number_of_channels, value);
}
} // namespace
@@ -40,8 +41,9 @@ TEST(AudioFrameManipulator, CompareForwardRampWithExpectedResultStereo) {
const int total_samples = kSamplesPerChannel * kNumberOfChannels;
const int16_t expected_result[total_samples] = {0, 0, 1, 1, 2, 2, 3, 3, 4, 4};
+ const int16_t* frame_data = frame.data();
EXPECT_TRUE(
- std::equal(frame.data_, frame.data_ + total_samples, expected_result));
+ std::equal(frame_data, frame_data + total_samples, expected_result));
}
TEST(AudioFrameManipulator, CompareBackwardRampWithExpectedResultMono) {
@@ -56,8 +58,9 @@ TEST(AudioFrameManipulator, CompareBackwardRampWithExpectedResultMono) {
const int total_samples = kSamplesPerChannel * kNumberOfChannels;
const int16_t expected_result[total_samples] = {5, 4, 3, 2, 1};
+ const int16_t* frame_data = frame.data();
EXPECT_TRUE(
- std::equal(frame.data_, frame.data_ + total_samples, expected_result));
+ std::equal(frame_data, frame_data + total_samples, expected_result));
}
} // namespace webrtc
« no previous file with comments | « webrtc/modules/audio_mixer/audio_frame_manipulator.cc ('k') | webrtc/modules/audio_mixer/audio_mixer_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698