Upstream version 7.36.149.0
[platform/framework/web/crosswalk.git] / src / third_party / webrtc / modules / audio_processing / echo_control_mobile_impl.cc
index 8434b61..a03adc5 100644 (file)
@@ -128,7 +128,7 @@ int EchoControlMobileImpl::ProcessCaptureAudio(AudioBuffer* audio) {
   for (int i = 0; i < audio->num_channels(); i++) {
     // TODO(ajm): improve how this works, possibly inside AECM.
     //            This is kind of hacked up.
-    int16_t* noisy = audio->low_pass_reference(i);
+    const int16_t* noisy = audio->low_pass_reference(i);
     int16_t* clean = audio->low_pass_split_data(i);
     if (noisy == NULL) {
       noisy = clean;
@@ -241,7 +241,7 @@ int EchoControlMobileImpl::Initialize() {
     return apm_->kNoError;
   }
 
-  if (apm_->sample_rate_hz() == apm_->kSampleRate32kHz) {
+  if (apm_->proc_sample_rate_hz() > apm_->kSampleRate16kHz) {
     LOG(LS_ERROR) << "AECM only supports 16 kHz or lower sample rates";
     return apm_->kBadSampleRateError;
   }
@@ -260,14 +260,14 @@ void* EchoControlMobileImpl::CreateHandle() const {
   return handle;
 }
 
-int EchoControlMobileImpl::DestroyHandle(void* handle) const {
-  return WebRtcAecm_Free(static_cast<Handle*>(handle));
+void EchoControlMobileImpl::DestroyHandle(void* handle) const {
+  WebRtcAecm_Free(static_cast<Handle*>(handle));
 }
 
 int EchoControlMobileImpl::InitializeHandle(void* handle) const {
   assert(handle != NULL);
   Handle* my_handle = static_cast<Handle*>(handle);
-  if (WebRtcAecm_Init(my_handle, apm_->sample_rate_hz()) != 0) {
+  if (WebRtcAecm_Init(my_handle, apm_->proc_sample_rate_hz()) != 0) {
     return GetHandleError(my_handle);
   }
   if (external_echo_path_ != NULL) {