diff options
author | Diego 'Flameeyes' Pettenò <flameeyes@gmail.com> | 2008-03-01 03:05:13 +0100 |
---|---|---|
committer | Diego 'Flameeyes' Pettenò <flameeyes@gmail.com> | 2008-03-01 03:05:13 +0100 |
commit | 1d0b3b20c34517b9d1ddf3ea347776304b0c4b44 (patch) | |
tree | 89f4fc640c2becc6f00ae08996754952ecf149c1 /contrib/ffmpeg/libavcodec/resample.c | |
parent | 09496ad3469a0ade8dbd9a351e639b78f20b7942 (diff) | |
download | xine-lib-1d0b3b20c34517b9d1ddf3ea347776304b0c4b44.tar.gz xine-lib-1d0b3b20c34517b9d1ddf3ea347776304b0c4b44.tar.bz2 |
Update internal FFmpeg copy.
Diffstat (limited to 'contrib/ffmpeg/libavcodec/resample.c')
-rw-r--r-- | contrib/ffmpeg/libavcodec/resample.c | 16 |
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) { |