diff options
author | andrew@webrtc.org <andrew@webrtc.org@4adac7df-926f-26a2-2b94-8c16560cd09d> | 2013-02-27 00:35:06 +0000 |
---|---|---|
committer | andrew@webrtc.org <andrew@webrtc.org@4adac7df-926f-26a2-2b94-8c16560cd09d> | 2013-02-27 00:35:06 +0000 |
commit | db32d60125dfe78a1eb475f39672484c63b034b1 (patch) | |
tree | fb7823d740fe4622c58eed79535c6083dc428267 /modules/audio_processing/aec/echo_cancellation.c | |
parent | 001d6ed42733fa77de2ca603005709dfb9d0e188 (diff) | |
download | webrtc-db32d60125dfe78a1eb475f39672484c63b034b1.tar.gz |
Refactor WebRtc_CreateBuffer to return the instance.
Review URL: https://webrtc-codereview.appspot.com/1140005
git-svn-id: http://webrtc.googlecode.com/svn/trunk/webrtc@3574 4adac7df-926f-26a2-2b94-8c16560cd09d
Diffstat (limited to 'modules/audio_processing/aec/echo_cancellation.c')
-rw-r--r-- | modules/audio_processing/aec/echo_cancellation.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/modules/audio_processing/aec/echo_cancellation.c b/modules/audio_processing/aec/echo_cancellation.c index 40662812..8fd9fe92 100644 --- a/modules/audio_processing/aec/echo_cancellation.c +++ b/modules/audio_processing/aec/echo_cancellation.c @@ -72,9 +72,9 @@ WebRtc_Word32 WebRtcAec_Create(void **aecInst) // Create far-end pre-buffer. The buffer size has to be large enough for // largest possible drift compensation (kResamplerBufferSize) + "almost" an // FFT buffer (PART_LEN2 - 1). - if (WebRtc_CreateBuffer(&aecpc->far_pre_buf, - PART_LEN2 + kResamplerBufferSize, - sizeof(float)) == -1) { + aecpc->far_pre_buf = WebRtc_CreateBuffer(PART_LEN2 + kResamplerBufferSize, + sizeof(float)); + if (!aecpc->far_pre_buf) { WebRtcAec_Free(aecpc); aecpc = NULL; return -1; @@ -84,9 +84,9 @@ WebRtc_Word32 WebRtcAec_Create(void **aecInst) aecpc->lastError = 0; #ifdef WEBRTC_AEC_DEBUG_DUMP - if (WebRtc_CreateBuffer(&aecpc->far_pre_buf_s16, - PART_LEN2 + kResamplerBufferSize, - sizeof(int16_t)) == -1) { + aecpc->far_pre_buf_s16 = WebRtc_CreateBuffer( + PART_LEN2 + kResamplerBufferSize, sizeof(float)); + if (!aecpc->far_pre_buf_s16) { WebRtcAec_Free(aecpc); aecpc = NULL; return -1; |