echo-cancel: Speex preprocessor has to run *after* the AEC.

This is how it is expected to be run.
This commit is contained in:
Bart Cerneels 2011-05-28 07:56:00 +05:30 committed by Arun Raghavan
parent 0ecf51119a
commit 4fd3efa46b

View file

@ -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);