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

Unified Diff: webrtc/modules/audio_coding/acm2/acm_receiver.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/acm_receiver.cc
diff --git a/webrtc/modules/audio_coding/acm2/acm_receiver.cc b/webrtc/modules/audio_coding/acm2/acm_receiver.cc
index 21dbc747ecb77302b6a4fae0ffbe70a93e906b37..9c3a63e7978186978c134554445dc5322749a2c7 100644
--- a/webrtc/modules/audio_coding/acm2/acm_receiver.cc
+++ b/webrtc/modules/audio_coding/acm2/acm_receiver.cc
@@ -150,10 +150,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;
@@ -171,7 +172,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_);

Powered by Google App Engine
This is Rietveld 408576698