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

Unified Diff: webrtc/modules/audio_processing/audio_buffer.cc

Issue 2053773002: Keep track of the user-facing number of channels in a ChannelBuffer (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Rebasing Created 4 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_processing/audio_buffer.cc
diff --git a/webrtc/modules/audio_processing/audio_buffer.cc b/webrtc/modules/audio_processing/audio_buffer.cc
index f9b9f631d2b813523ed4a9935ecbc3c0af2ab3bd..13ece67f254f9fcdc5115a58db28e9de411954f5 100644
--- a/webrtc/modules/audio_processing/audio_buffer.cc
+++ b/webrtc/modules/audio_processing/audio_buffer.cc
@@ -184,6 +184,10 @@ void AudioBuffer::InitForNewData() {
reference_copied_ = false;
activity_ = AudioFrame::kVadUnknown;
num_channels_ = num_proc_channels_;
+ data_->set_num_channels(num_proc_channels_);
+ if (split_data_.get()) {
+ split_data_->set_num_channels(num_proc_channels_);
+ }
}
const int16_t* const* AudioBuffer::channels_const() const {
@@ -345,6 +349,10 @@ size_t AudioBuffer::num_channels() const {
void AudioBuffer::set_num_channels(size_t num_channels) {
num_channels_ = num_channels;
+ data_->set_num_channels(num_channels);
+ if (split_data_.get()) {
+ split_data_->set_num_channels(num_channels);
+ }
}
size_t AudioBuffer::num_frames() const {
« no previous file with comments | « webrtc/modules/audio_processing/audio_buffer.h ('k') | webrtc/modules/audio_processing/audio_buffer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698