From: Bart Cerneels Date: Sat, 28 May 2011 02:26:00 +0000 (+0530) Subject: echo-cancel: Speex preprocessor has to run *after* the AEC. X-Git-Tag: v0.99.1~93 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=4fd3efa46b33726d489af933e709289d20ed5ea0;p=platform%2Fupstream%2Fpulseaudio.git echo-cancel: Speex preprocessor has to run *after* the AEC. This is how it is expected to be run. --- diff --git a/src/modules/echo-cancel/module-echo-cancel.c b/src/modules/echo-cancel/module-echo-cancel.c index e83839a..90577d4 100644 --- a/src/modules/echo-cancel/module-echo-cancel.c +++ b/src/modules/echo-cancel/module-echo-cancel.c @@ -726,12 +726,13 @@ static void source_output_push_cb(pa_source_output *o, const pa_memchunk *chunk) fwrite(pdata, 1, u->blocksize, u->played_file); } - if (u->ec->pp_state) - speex_preprocess_run(u->ec->pp_state, (spx_int16_t *) rdata); - /* perform echo cancelation */ u->ec->run(u->ec, rdata, pdata, cdata); + /* preprecessor is run after AEC. This is not a mistake! */ + if (u->ec->pp_state) + speex_preprocess_run(u->ec->pp_state, (spx_int16_t *) cdata); + if (u->save_aec) { if (u->canceled_file) fwrite(cdata, 1, u->blocksize, u->canceled_file);