summaryrefslogtreecommitdiff
path: root/contrib/ffmpeg/libavcodec/resample.c
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/ffmpeg/libavcodec/resample.c')
-rw-r--r--contrib/ffmpeg/libavcodec/resample.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/contrib/ffmpeg/libavcodec/resample.c b/contrib/ffmpeg/libavcodec/resample.c
index ea5c6d61c..c6547d8d8 100644
--- a/contrib/ffmpeg/libavcodec/resample.c
+++ b/contrib/ffmpeg/libavcodec/resample.c
@@ -1,5 +1,5 @@
/*
- * Sample rate convertion for both audio and video
+ * samplerate conversion for both audio and video
* Copyright (c) 2000 Fabrice Bellard.
*
* This file is part of FFmpeg.
@@ -21,7 +21,7 @@
/**
* @file resample.c
- * Sample rate convertion for both audio and video.
+ * samplerate conversion for both audio and video
*/
#include "avcodec.h"
@@ -133,14 +133,14 @@ ReSampleContext *audio_resample_init(int output_channels, int input_channels,
if ( input_channels > 2)
{
- av_log(NULL, AV_LOG_ERROR, "Resampling with input channels greater than 2 unsupported.");
+ av_log(NULL, AV_LOG_ERROR, "Resampling with input channels greater than 2 unsupported.\n");
return NULL;
}
s = av_mallocz(sizeof(ReSampleContext));
if (!s)
{
- av_log(NULL, AV_LOG_ERROR, "Can't allocate memory for resample context.");
+ av_log(NULL, AV_LOG_ERROR, "Can't allocate memory for resample context.\n");
return NULL;
}
@@ -185,15 +185,15 @@ int audio_resample(ReSampleContext *s, short *output, short *input, int nb_sampl
/* XXX: move those malloc to resample init code */
for(i=0; i<s->filter_channels; i++){
- bufin[i]= (short*) av_malloc( (nb_samples + s->temp_len) * sizeof(short) );
+ bufin[i]= av_malloc( (nb_samples + s->temp_len) * sizeof(short) );
memcpy(bufin[i], s->temp[i], s->temp_len * sizeof(short));
buftmp2[i] = bufin[i] + s->temp_len;
}
/* make some zoom to avoid round pb */
- lenout= (int)(nb_samples * s->ratio) + 16;
- bufout[0]= (short*) av_malloc( lenout * sizeof(short) );
- bufout[1]= (short*) av_malloc( lenout * sizeof(short) );
+ lenout= 4*nb_samples * s->ratio + 16;
+ bufout[0]= av_malloc( lenout * sizeof(short) );
+ bufout[1]= av_malloc( lenout * sizeof(short) );
if (s->input_channels == 2 &&
s->output_channels == 1) {