From e57ae0232769b8317ddcaaddfc4d33698ebd21ba Mon Sep 17 00:00:00 2001 From: "kwiberg@webrtc.org" Date: Thu, 17 Apr 2014 12:28:33 +0000 Subject: [PATCH] WebRtcAecm_Process: Reduce code duplication BUG= R=bjornv@webrtc.org Review URL: https://webrtc-codereview.appspot.com/12119004 git-svn-id: http://webrtc.googlecode.com/svn/trunk@5930 4adac7df-926f-26a2-2b94-8c16560cd09d --- .../aecm/echo_control_mobile.c | 29 +++++-------------- 1 file changed, 8 insertions(+), 21 deletions(-) diff --git a/webrtc/modules/audio_processing/aecm/echo_control_mobile.c b/webrtc/modules/audio_processing/aecm/echo_control_mobile.c index b896de0a21..088bbf03f7 100644 --- a/webrtc/modules/audio_processing/aecm/echo_control_mobile.c +++ b/webrtc/modules/audio_processing/aecm/echo_control_mobile.c @@ -443,27 +443,14 @@ int32_t WebRtcAecm_Process(void *aecmInst, const int16_t *nearendNoisy, // Call the AECM /*WebRtcAecm_ProcessFrame(aecm->aecmCore, farend, &nearend[FRAME_LEN * i], &out[FRAME_LEN * i], aecm->knownDelay);*/ - if (nearendClean == NULL) - { - if (WebRtcAecm_ProcessFrame(aecm->aecmCore, - farend_ptr, - &nearendNoisy[FRAME_LEN * i], - NULL, - &out[FRAME_LEN * i]) == -1) - { - return -1; - } - } else - { - if (WebRtcAecm_ProcessFrame(aecm->aecmCore, - farend_ptr, - &nearendNoisy[FRAME_LEN * i], - &nearendClean[FRAME_LEN * i], - &out[FRAME_LEN * i]) == -1) - { - return -1; - } - } + if (WebRtcAecm_ProcessFrame(aecm->aecmCore, + farend_ptr, + &nearendNoisy[FRAME_LEN * i], + (nearendClean + ? &nearendClean[FRAME_LEN * i] + : NULL), + &out[FRAME_LEN * i]) == -1) + return -1; } }