Index: webrtc/modules/audio_processing/echo_cancellation_impl.cc |
diff --git a/webrtc/modules/audio_processing/echo_cancellation_impl.cc b/webrtc/modules/audio_processing/echo_cancellation_impl.cc |
index c6f92005a50f0fc4b5ded8226dd956fa726efced..d8de5d2b3b8dec81530d52817e66dcda158a750f 100644 |
--- a/webrtc/modules/audio_processing/echo_cancellation_impl.cc |
+++ b/webrtc/modules/audio_processing/echo_cancellation_impl.cc |
@@ -55,9 +55,6 @@ AudioProcessing::Error MapError(int err) { |
} |
} // namespace |
-const size_t EchoCancellationImpl::kAllowedValuesOfSamplesPerFrame1; |
-const size_t EchoCancellationImpl::kAllowedValuesOfSamplesPerFrame2; |
- |
EchoCancellationImpl::EchoCancellationImpl(const AudioProcessing* apm, |
CriticalSectionWrapper* crit) |
: ProcessingComponent(), |
@@ -72,9 +69,7 @@ EchoCancellationImpl::EchoCancellationImpl(const AudioProcessing* apm, |
delay_logging_enabled_(false), |
extended_filter_enabled_(false), |
delay_agnostic_enabled_(false), |
- render_queue_element_max_size_(0) { |
- AllocateRenderQueue(); |
-} |
+ render_queue_element_max_size_(0) {} |
EchoCancellationImpl::~EchoCancellationImpl() {} |
@@ -384,8 +379,9 @@ int EchoCancellationImpl::Initialize() { |
} |
void EchoCancellationImpl::AllocateRenderQueue() { |
- const size_t max_frame_size = std::max<size_t>( |
- kAllowedValuesOfSamplesPerFrame1, kAllowedValuesOfSamplesPerFrame2); |
+ const size_t max_frame_size = |
+ std::max<size_t>(static_cast<size_t>(kAllowedValuesOfSamplesPerFrame1), |
the sun
2015/11/17 13:44:37
It seems wasteful to me to do this at runtime. Why
peah-webrtc
2015/11/18 05:53:46
Good point!
Done.
|
+ static_cast<size_t>(kAllowedValuesOfSamplesPerFrame2)); |
const size_t new_render_queue_element_max_size = std::max<size_t>( |
static_cast<size_t>(1), max_frame_size * num_handles_required()); |
@@ -401,12 +397,12 @@ void EchoCancellationImpl::AllocateRenderQueue() { |
new SwapQueue<std::vector<float>, RenderQueueItemVerifier<float>>( |
kMaxNumFramesToBuffer, template_queue_element, |
the sun
2015/11/17 13:44:37
Move kMaxNumFramesToBuffer into the anonymous name
peah-webrtc
2015/11/18 05:53:46
Done.
|
RenderQueueItemVerifier<float>(render_queue_element_max_size_))); |
+ |
+ render_queue_buffer_.resize(render_queue_element_max_size_); |
+ capture_queue_buffer_.resize(render_queue_element_max_size_); |
} else { |
render_signal_queue_->Clear(); |
} |
- |
- render_queue_buffer_.resize(new_render_queue_element_max_size); |
- capture_queue_buffer_.resize(new_render_queue_element_max_size); |
} |
void EchoCancellationImpl::SetExtraOptions(const Config& config) { |