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

Unified Diff: webrtc/common_audio/channel_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
« no previous file with comments | « webrtc/common_audio/channel_buffer.h ('k') | webrtc/common_audio/channel_buffer_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/common_audio/channel_buffer.cc
diff --git a/webrtc/common_audio/channel_buffer.cc b/webrtc/common_audio/channel_buffer.cc
index 349d4245ccdb6e472db3cb60ee3a951c1e333b3b..cc0001b944d7f8dfd79ab9e55dabb23e7b06a715 100644
--- a/webrtc/common_audio/channel_buffer.cc
+++ b/webrtc/common_audio/channel_buffer.cc
@@ -47,6 +47,7 @@ const ChannelBuffer<float>* IFChannelBuffer::fbuf_const() const {
void IFChannelBuffer::RefreshF() const {
if (!fvalid_) {
RTC_DCHECK(ivalid_);
+ fbuf_.set_num_channels(ibuf_.num_channels());
const int16_t* const* int_channels = ibuf_.channels();
float* const* float_channels = fbuf_.channels();
for (size_t i = 0; i < ibuf_.num_channels(); ++i) {
@@ -62,8 +63,9 @@ void IFChannelBuffer::RefreshI() const {
if (!ivalid_) {
RTC_DCHECK(fvalid_);
int16_t* const* int_channels = ibuf_.channels();
+ ibuf_.set_num_channels(fbuf_.num_channels());
const float* const* float_channels = fbuf_.channels();
- for (size_t i = 0; i < ibuf_.num_channels(); ++i) {
+ for (size_t i = 0; i < fbuf_.num_channels(); ++i) {
FloatS16ToS16(float_channels[i],
ibuf_.num_frames(),
int_channels[i]);
« no previous file with comments | « webrtc/common_audio/channel_buffer.h ('k') | webrtc/common_audio/channel_buffer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698