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

Unified Diff: webrtc/modules/audio_coding/acm2/acm_receiver.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/acm_receiver.cc
diff --git a/webrtc/modules/audio_coding/acm2/acm_receiver.cc b/webrtc/modules/audio_coding/acm2/acm_receiver.cc
index 553265e44872b65b49ac619af39b61b0c74446d8..a2a5eb772876421d55cb2810bdc7b32def803f55 100644
--- a/webrtc/modules/audio_coding/acm2/acm_receiver.cc
+++ b/webrtc/modules/audio_coding/acm2/acm_receiver.cc
@@ -154,10 +154,11 @@ int AcmReceiver::GetAudio(int desired_freq_hz,
// TODO(henrik.lundin) Glitches in the output may appear if the output rate
// from NetEq changes. See WebRTC issue 3923.
if (need_resampling) {
+ // TODO(yujo): handle this more efficiently for muted frames.
int samples_per_channel_int = resampler_.Resample10Msec(
- audio_frame->data_, current_sample_rate_hz, desired_freq_hz,
+ audio_frame->data(), current_sample_rate_hz, desired_freq_hz,
audio_frame->num_channels_, AudioFrame::kMaxDataSizeSamples,
- audio_frame->data_);
+ audio_frame->mutable_data());
if (samples_per_channel_int < 0) {
LOG(LERROR) << "AcmReceiver::GetAudio - Resampling audio_buffer_ failed.";
return -1;
@@ -175,7 +176,7 @@ int AcmReceiver::GetAudio(int desired_freq_hz,
}
// Store current audio in |last_audio_buffer_| for next time.
- memcpy(last_audio_buffer_.get(), audio_frame->data_,
+ memcpy(last_audio_buffer_.get(), audio_frame->data(),
sizeof(int16_t) * audio_frame->samples_per_channel_ *
audio_frame->num_channels_);
« no previous file with comments | « webrtc/audio/utility/audio_frame_operations_unittest.cc ('k') | webrtc/modules/audio_coding/acm2/acm_receiver_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698