# HG changeset patch # User anders # Date 1041313340 0 # Node ID 93212da0032e6a96408ba685872f6b7410423147 # Parent 4c0882ee0f4d8de8361ac9aa9c25f29f3fc36ce2 10l memory leak + bug fixes in ms to sample time conversion diff -r 4c0882ee0f4d -r 93212da0032e libaf/af.h --- a/libaf/af.h Tue Dec 31 02:37:36 2002 +0000 +++ b/libaf/af.h Tue Dec 31 05:42:20 2002 +0000 @@ -187,9 +187,9 @@ AF_OK if of and AF_ERROR if fail */ int af_to_dB(int n, float* in, float* out, float k); /* Helper function used to convert from ms to sample time*/ -int af_from_ms(int n, float* in, float* out, int rate, float mi, float ma); +int af_from_ms(int n, float* in, int* out, int rate, float mi, float ma); /* Helper function used to convert from sample time to ms */ -int af_to_ms(int n, float* in, float* out, int rate); +int af_to_ms(int n, int* in, float* out, int rate); /* Helper function for testing the output format */ int af_test_output(struct af_instance_s* af, af_data_t* out); diff -r 4c0882ee0f4d -r 93212da0032e libaf/af_comp.c --- a/libaf/af_comp.c Tue Dec 31 02:37:36 2002 +0000 +++ b/libaf/af_comp.c Tue Dec 31 05:42:20 2002 +0000 @@ -26,8 +26,8 @@ float time[AF_NCH]; // Forgetting factor for power estimate float pow[AF_NCH]; // Estimated power level [dB] float tresh[AF_NCH]; // Threshold [dB] - float attack[AF_NCH]; // Attack time [ms] - float release[AF_NCH]; // Release time [ms] + int attack[AF_NCH]; // Attack time [ms] + int release[AF_NCH]; // Release time [ms] float ratio[AF_NCH]; // Compression ratio }af_comp_t; diff -r 4c0882ee0f4d -r 93212da0032e libaf/af_gate.c --- a/libaf/af_gate.c Tue Dec 31 02:37:36 2002 +0000 +++ b/libaf/af_gate.c Tue Dec 31 05:42:20 2002 +0000 @@ -26,8 +26,8 @@ float time[AF_NCH]; // Forgetting factor for power estimate float pow[AF_NCH]; // Estimated power level [dB] float tresh[AF_NCH]; // Threshold [dB] - float attack[AF_NCH]; // Attack time [ms] - float release[AF_NCH]; // Release time [ms] + int attack[AF_NCH]; // Attack time [ms] + int release[AF_NCH]; // Release time [ms] float range[AF_NCH]; // Range level [dB] }af_gate_t; diff -r 4c0882ee0f4d -r 93212da0032e libaf/af_pan.c --- a/libaf/af_pan.c Tue Dec 31 02:37:36 2002 +0000 +++ b/libaf/af_pan.c Tue Dec 31 05:42:20 2002 +0000 @@ -113,6 +113,8 @@ // Deallocate memory static void uninit(struct af_instance_s* af) { + if(af->data->audio) + free(af->data->audio); if(af->data) free(af->data); if(af->setup) diff -r 4c0882ee0f4d -r 93212da0032e libaf/af_tools.c --- a/libaf/af_tools.c Tue Dec 31 02:37:36 2002 +0000 +++ b/libaf/af_tools.c Tue Dec 31 05:42:20 2002 +0000 @@ -29,7 +29,7 @@ if(!in || !out) return AF_ERROR; - for(i=0;i