X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavcodec%2Fresample.c;h=76521a75e0fb7672b4101f85a68c70dc617a1683;hb=55bf7fb6130a2a13c30498a787d6dfead39ecceb;hp=043e812c8fa8b159897bec713fd589fc483168b7;hpb=b78e7197a81e193827cf2408fe25bc1f14843a72;p=ffmpeg diff --git a/libavcodec/resample.c b/libavcodec/resample.c index 043e812c8fa..76521a75e0f 100644 --- a/libavcodec/resample.c +++ b/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" @@ -161,7 +161,8 @@ ReSampleContext *audio_resample_init(int output_channels, int input_channels, if(s->filter_channels>2) s->filter_channels = 2; - s->resample_context= av_resample_init(output_rate, input_rate, 16, 10, 0, 1.0); +#define TAPS 16 + s->resample_context= av_resample_init(output_rate, input_rate, TAPS, 10, 0, 0.8); return s; } @@ -190,7 +191,7 @@ int audio_resample(ReSampleContext *s, short *output, short *input, int nb_sampl } /* make some zoom to avoid round pb */ - lenout= (int)(nb_samples * s->ratio) + 16; + lenout= (int)(4*nb_samples * s->ratio) + 16; bufout[0]= (short*) av_malloc( lenout * sizeof(short) ); bufout[1]= (short*) av_malloc( lenout * sizeof(short) );