[pulseaudio-commits] 2 commits - src/modules

Arun Raghavan arun at kemper.freedesktop.org
Tue Jun 14 16:03:45 PDT 2011


 src/modules/echo-cancel/module-echo-cancel.c |   10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

New commits:
commit 4e9328cb934ecbc1bec6acfd40994d8a048dac72
Author: Arun Raghavan <arun.raghavan at collabora.co.uk>
Date:   Mon Jun 13 13:42:01 2011 -0700

    echo-cancel: More preprocessing fixes
    
    The speex_preprocess_ctl() function takes a spx_int32_t, but we've been
    passing a pa_bool_t, which could potentially crash.

diff --git a/src/modules/echo-cancel/module-echo-cancel.c b/src/modules/echo-cancel/module-echo-cancel.c
index c406508..96eb9ef 100644
--- a/src/modules/echo-cancel/module-echo-cancel.c
+++ b/src/modules/echo-cancel/module-echo-cancel.c
@@ -1476,6 +1476,8 @@ int pa__init(pa_module*m) {
     }
 
     if (u->ec->agc || u->ec->denoise || u->ec->echo_suppress) {
+        spx_int32_t tmp;
+
         if (source_ss.channels != 1) {
             pa_log("AGC, denoising and echo suppression only work with channels=1");
             goto fail;
@@ -1483,8 +1485,10 @@ int pa__init(pa_module*m) {
 
         u->ec->pp_state = speex_preprocess_state_init(u->blocksize / pa_frame_size(&source_ss), source_ss.rate);
 
-        speex_preprocess_ctl(u->ec->pp_state, SPEEX_PREPROCESS_SET_AGC, &u->ec->agc);
-        speex_preprocess_ctl(u->ec->pp_state, SPEEX_PREPROCESS_SET_DENOISE, &u->ec->denoise);
+        tmp = u->ec->agc;
+        speex_preprocess_ctl(u->ec->pp_state, SPEEX_PREPROCESS_SET_AGC, &tmp);
+        tmp = u->ec->denoise;
+        speex_preprocess_ctl(u->ec->pp_state, SPEEX_PREPROCESS_SET_DENOISE, &tmp);
         if (u->ec->echo_suppress) {
             if (u->ec->echo_suppress_attenuation)
                 speex_preprocess_ctl(u->ec->pp_state, SPEEX_PREPROCESS_SET_ECHO_SUPPRESS, &u->ec->echo_suppress_attenuation);

commit b2f83b2502233f0fcfbf6bf78df9c03f5265d4de
Author: Arun Raghavan <arun.raghavan at collabora.co.uk>
Date:   Mon Jun 13 13:40:33 2011 -0700

    echo-cancel: Fix preprocessor initialisation
    
    We were using the block size in bytes instead of samples, which meant
    preprocessing was broken. This fix makes a large-ish difference in the
    quality of echo-cancellation with speex.

diff --git a/src/modules/echo-cancel/module-echo-cancel.c b/src/modules/echo-cancel/module-echo-cancel.c
index cb30832..c406508 100644
--- a/src/modules/echo-cancel/module-echo-cancel.c
+++ b/src/modules/echo-cancel/module-echo-cancel.c
@@ -1481,7 +1481,7 @@ int pa__init(pa_module*m) {
             goto fail;
         }
 
-        u->ec->pp_state = speex_preprocess_state_init(u->blocksize, source_ss.rate);
+        u->ec->pp_state = speex_preprocess_state_init(u->blocksize / pa_frame_size(&source_ss), source_ss.rate);
 
         speex_preprocess_ctl(u->ec->pp_state, SPEEX_PREPROCESS_SET_AGC, &u->ec->agc);
         speex_preprocess_ctl(u->ec->pp_state, SPEEX_PREPROCESS_SET_DENOISE, &u->ec->denoise);



More information about the pulseaudio-commits mailing list