aboutsummaryrefslogtreecommitdiff
path: root/webrtc/modules/audio_processing/aecm
diff options
context:
space:
mode:
authorBjorn Volcker <bjornv@chromium.org>2015-04-10 07:56:57 +0200
committerBjorn Volcker <bjornv@chromium.org>2015-04-10 05:56:59 +0000
commitf6a99e63b6e18d3b3db25e0059a4979743046f31 (patch)
treea3c8cf5c64da28cb84b3c616ca444c7b2fc9f7b4 /webrtc/modules/audio_processing/aecm
parent0666a9b28bfbf8ff81ff2183c9463e277998fabc (diff)
downloadwebrtc-f6a99e63b6e18d3b3db25e0059a4979743046f31.tar.gz
Refactor audio_processing: Free functions return void
There is no point in returning an error when Free() fails. In fact it can only happen if we have a null pointer as object. There is further no place where the return value is used. Affected components are - aec - aecm - agc - ns BUG=441 R=kwiberg@webrtc.org Review URL: https://webrtc-codereview.appspot.com/50579004 Cr-Commit-Position: refs/heads/master@{#8966}
Diffstat (limited to 'webrtc/modules/audio_processing/aecm')
-rw-r--r--webrtc/modules/audio_processing/aecm/aecm_core.c9
-rw-r--r--webrtc/modules/audio_processing/aecm/aecm_core.h6
-rw-r--r--webrtc/modules/audio_processing/aecm/echo_control_mobile.c10
-rw-r--r--webrtc/modules/audio_processing/aecm/include/echo_control_mobile.h7
4 files changed, 8 insertions, 24 deletions
diff --git a/webrtc/modules/audio_processing/aecm/aecm_core.c b/webrtc/modules/audio_processing/aecm/aecm_core.c
index c95c1f2af5..6741acba14 100644
--- a/webrtc/modules/audio_processing/aecm/aecm_core.c
+++ b/webrtc/modules/audio_processing/aecm/aecm_core.c
@@ -546,10 +546,9 @@ int WebRtcAecm_Control(AecmCore* aecm, int delay, int nlpFlag) {
return 0;
}
-int WebRtcAecm_FreeCore(AecmCore* aecm) {
- if (aecm == NULL)
- {
- return -1;
+void WebRtcAecm_FreeCore(AecmCore* aecm) {
+ if (aecm == NULL) {
+ return;
}
WebRtc_FreeBuffer(aecm->farFrameBuf);
@@ -562,8 +561,6 @@ int WebRtcAecm_FreeCore(AecmCore* aecm) {
WebRtcSpl_FreeRealFFT(aecm->real_fft);
free(aecm);
-
- return 0;
}
int WebRtcAecm_ProcessFrame(AecmCore* aecm,
diff --git a/webrtc/modules/audio_processing/aecm/aecm_core.h b/webrtc/modules/audio_processing/aecm/aecm_core.h
index 03655b90c7..15614d67fa 100644
--- a/webrtc/modules/audio_processing/aecm/aecm_core.h
+++ b/webrtc/modules/audio_processing/aecm/aecm_core.h
@@ -174,11 +174,7 @@ int WebRtcAecm_InitCore(AecmCore* const aecm, int samplingFreq);
// Input:
// - aecm : Pointer to the AECM instance
//
-// Return value : 0 - Ok
-// -1 - Error
-// 11001-11016: Error
-//
-int WebRtcAecm_FreeCore(AecmCore* aecm);
+void WebRtcAecm_FreeCore(AecmCore* aecm);
int WebRtcAecm_Control(AecmCore* aecm, int delay, int nlpFlag);
diff --git a/webrtc/modules/audio_processing/aecm/echo_control_mobile.c b/webrtc/modules/audio_processing/aecm/echo_control_mobile.c
index 389433b8fd..2424839ac4 100644
--- a/webrtc/modules/audio_processing/aecm/echo_control_mobile.c
+++ b/webrtc/modules/audio_processing/aecm/echo_control_mobile.c
@@ -130,13 +130,11 @@ int32_t WebRtcAecm_Create(void **aecmInst)
return 0;
}
-int32_t WebRtcAecm_Free(void *aecmInst)
-{
+void WebRtcAecm_Free(void* aecmInst) {
AecMobile* aecm = aecmInst;
- if (aecm == NULL)
- {
- return -1;
+ if (aecm == NULL) {
+ return;
}
#ifdef AEC_DEBUG
@@ -153,8 +151,6 @@ int32_t WebRtcAecm_Free(void *aecmInst)
WebRtcAecm_FreeCore(aecm->aecmCore);
WebRtc_FreeBuffer(aecm->farendBuf);
free(aecm);
-
- return 0;
}
int32_t WebRtcAecm_Init(void *aecmInst, int32_t sampFreq)
diff --git a/webrtc/modules/audio_processing/aecm/include/echo_control_mobile.h b/webrtc/modules/audio_processing/aecm/include/echo_control_mobile.h
index ac43576dd2..617c9602dc 100644
--- a/webrtc/modules/audio_processing/aecm/include/echo_control_mobile.h
+++ b/webrtc/modules/audio_processing/aecm/include/echo_control_mobile.h
@@ -61,13 +61,8 @@ int32_t WebRtcAecm_Create(void **aecmInst);
* Inputs Description
* -------------------------------------------------------------------
* void* aecmInst Pointer to the AECM instance
- *
- * Outputs Description
- * -------------------------------------------------------------------
- * int32_t return 0: OK
- * -1: error
*/
-int32_t WebRtcAecm_Free(void *aecmInst);
+void WebRtcAecm_Free(void* aecmInst);
/*
* Initializes an AECM instance.