aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/resample.c
diff options
context:
space:
mode:
authorFabrice Bellard <fabrice@bellard.org>2002-05-18 23:03:29 +0000
committerFabrice Bellard <fabrice@bellard.org>2002-05-18 23:03:29 +0000
commit6000abfa89295801abb8525e6fe7e13dbcc36610 (patch)
tree3ebb212898b99c09eb1dd3a1714cc5c8f617bff3 /libavcodec/resample.c
parent4cc281d9d970b0b004f20ee76cae427f374bd082 (diff)
downloadffmpeg-6000abfa89295801abb8525e6fe7e13dbcc36610.tar.gz
removed useless header includes - use av memory functions
Originally committed as revision 522 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/resample.c')
-rw-r--r--libavcodec/resample.c23
1 files changed, 11 insertions, 12 deletions
diff --git a/libavcodec/resample.c b/libavcodec/resample.c
index 78b4ad8126..8c5e1fa892 100644
--- a/libavcodec/resample.c
+++ b/libavcodec/resample.c
@@ -17,7 +17,6 @@
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include "avcodec.h"
-#include <math.h>
typedef struct {
/* fractional resampling */
@@ -193,7 +192,7 @@ static int mono_resample(ReSampleChannelContext *s, short *output, short *input,
short *buf1;
short *buftmp;
- buf1= (short*) malloc( nb_samples * sizeof(short) );
+ buf1= (short*)av_malloc( nb_samples * sizeof(short) );
/* first downsample by an integer factor with averaging filter */
if (s->iratio > 1) {
@@ -209,7 +208,7 @@ static int mono_resample(ReSampleChannelContext *s, short *output, short *input,
} else {
memcpy(output, buftmp, nb_samples * sizeof(short));
}
- free(buf1);
+ av_free(buf1);
return nb_samples;
}
@@ -260,13 +259,13 @@ int audio_resample(ReSampleContext *s, short *output, short *input, int nb_sampl
}
/* XXX: move those malloc to resample init code */
- bufin[0]= (short*) malloc( nb_samples * sizeof(short) );
- bufin[1]= (short*) malloc( nb_samples * sizeof(short) );
+ bufin[0]= (short*) av_malloc( nb_samples * sizeof(short) );
+ bufin[1]= (short*) av_malloc( nb_samples * sizeof(short) );
/* make some zoom to avoid round pb */
lenout= (int)(nb_samples * s->ratio) + 16;
- bufout[0]= (short*) malloc( lenout * sizeof(short) );
- bufout[1]= (short*) malloc( lenout * sizeof(short) );
+ bufout[0]= (short*) av_malloc( lenout * sizeof(short) );
+ bufout[1]= (short*) av_malloc( lenout * sizeof(short) );
if (s->input_channels == 2 &&
s->output_channels == 1) {
@@ -299,15 +298,15 @@ int audio_resample(ReSampleContext *s, short *output, short *input, int nb_sampl
stereo_mux(output, buftmp3[0], buftmp3[1], nb_samples1);
}
- free(bufin[0]);
- free(bufin[1]);
+ av_free(bufin[0]);
+ av_free(bufin[1]);
- free(bufout[0]);
- free(bufout[1]);
+ av_free(bufout[0]);
+ av_free(bufout[1]);
return nb_samples1;
}
void audio_resample_close(ReSampleContext *s)
{
- free(s);
+ av_free(s);
}