From 59a1b1b92850747a0e758b9668f725ed9e961a33 Mon Sep 17 00:00:00 2001 From: "aluebs@webrtc.org" Date: Thu, 28 Aug 2014 10:43:09 +0000 Subject: [PATCH] Fix the different samples per channel in aecdump BUG=webrtc:3359 R=bjornv@webrtc.org Review URL: https://webrtc-codereview.appspot.com/15299004 git-svn-id: http://webrtc.googlecode.com/svn/trunk@6996 4adac7df-926f-26a2-2b94-8c16560cd09d --- webrtc/modules/audio_processing/audio_processing_impl.cc | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/webrtc/modules/audio_processing/audio_processing_impl.cc b/webrtc/modules/audio_processing/audio_processing_impl.cc index cc2b5c002..9d7f1ec31 100644 --- a/webrtc/modules/audio_processing/audio_processing_impl.cc +++ b/webrtc/modules/audio_processing/audio_processing_impl.cc @@ -367,7 +367,8 @@ int AudioProcessingImpl::ProcessStream(const float* const* src, if (debug_file_->Open()) { event_msg_->set_type(audioproc::Event::STREAM); audioproc::Stream* msg = event_msg_->mutable_stream(); - const size_t channel_size = sizeof(float) * samples_per_channel; + const size_t channel_size = + sizeof(float) * fwd_in_format_.samples_per_channel(); for (int i = 0; i < fwd_in_format_.num_channels(); ++i) msg->add_input_channel(src[i], channel_size); } @@ -384,7 +385,8 @@ int AudioProcessingImpl::ProcessStream(const float* const* src, #ifdef WEBRTC_AUDIOPROC_DEBUG_DUMP if (debug_file_->Open()) { audioproc::Stream* msg = event_msg_->mutable_stream(); - const size_t channel_size = sizeof(float) * samples_per_channel; + const size_t channel_size = + sizeof(float) * fwd_out_format_.samples_per_channel(); for (int i = 0; i < fwd_proc_format_.num_channels(); ++i) msg->add_output_channel(dest[i], channel_size); RETURN_ON_ERR(WriteMessageToDebugFile()); @@ -533,7 +535,8 @@ int AudioProcessingImpl::AnalyzeReverseStream(const float* const* data, if (debug_file_->Open()) { event_msg_->set_type(audioproc::Event::REVERSE_STREAM); audioproc::ReverseStream* msg = event_msg_->mutable_reverse_stream(); - const size_t channel_size = sizeof(float) * samples_per_channel; + const size_t channel_size = + sizeof(float) * rev_in_format_.samples_per_channel(); for (int i = 0; i < num_channels; ++i) msg->add_channel(data[i], channel_size); RETURN_ON_ERR(WriteMessageToDebugFile());