mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-04 13:29:59 -05:00
echo-cancel: Fix memory leak / deinitialization of Adrian AEC
was simply absent Signed-off-by: Peter Meerwald <p.meerwald@bct-electronic.com>
This commit is contained in:
parent
c43e885537
commit
bf29c8dcf7
4 changed files with 18 additions and 3 deletions
|
|
@ -106,6 +106,17 @@ AEC* AEC_init(int RATE, int have_vector)
|
||||||
return a;
|
return a;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void AEC_done(AEC *a) {
|
||||||
|
pa_assert(a);
|
||||||
|
|
||||||
|
pa_xfree(a->Fx);
|
||||||
|
pa_xfree(a->Fe);
|
||||||
|
pa_xfree(a->acMic);
|
||||||
|
pa_xfree(a->acSpk);
|
||||||
|
pa_xfree(a->cutoff);
|
||||||
|
pa_xfree(a);
|
||||||
|
}
|
||||||
|
|
||||||
// Adrian soft decision DTD
|
// Adrian soft decision DTD
|
||||||
// (Dual Average Near-End to Far-End signal Ratio DTD)
|
// (Dual Average Near-End to Far-End signal Ratio DTD)
|
||||||
// This algorithm uses exponential smoothing with differnt
|
// This algorithm uses exponential smoothing with differnt
|
||||||
|
|
|
||||||
|
|
@ -351,7 +351,8 @@ static void AEC_leaky(AEC *a);
|
||||||
*/
|
*/
|
||||||
static REAL AEC_nlms_pw(AEC *a, REAL d, REAL x_, float stepsize);
|
static REAL AEC_nlms_pw(AEC *a, REAL d, REAL x_, float stepsize);
|
||||||
|
|
||||||
AEC* AEC_init(int RATE, int have_vector);
|
AEC* AEC_init(int RATE, int have_vector);
|
||||||
|
void AEC_done(AEC *a);
|
||||||
|
|
||||||
/* Acoustic Echo Cancellation and Suppression of one sample
|
/* Acoustic Echo Cancellation and Suppression of one sample
|
||||||
* in d: microphone signal with echo
|
* in d: microphone signal with echo
|
||||||
|
|
|
||||||
|
|
@ -111,6 +111,8 @@ void pa_adrian_ec_run(pa_echo_canceller *ec, const uint8_t *rec, const uint8_t *
|
||||||
}
|
}
|
||||||
|
|
||||||
void pa_adrian_ec_done(pa_echo_canceller *ec) {
|
void pa_adrian_ec_done(pa_echo_canceller *ec) {
|
||||||
pa_xfree(ec->params.priv.adrian.aec);
|
if (ec->params.priv.adrian.aec) {
|
||||||
ec->params.priv.adrian.aec = NULL;
|
AEC_done(ec->params.priv.adrian.aec);
|
||||||
|
ec->params.priv.adrian.aec = NULL;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -28,4 +28,5 @@
|
||||||
typedef struct AEC AEC;
|
typedef struct AEC AEC;
|
||||||
|
|
||||||
AEC* AEC_init(int RATE, int have_vector);
|
AEC* AEC_init(int RATE, int have_vector);
|
||||||
|
void AEC_done(AEC *a);
|
||||||
int AEC_doAEC(AEC *a, int d_, int x_);
|
int AEC_doAEC(AEC *a, int d_, int x_);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue