[vlc-devel] [PATCH] speex: don't run if we don't need resampling

Rafaël Carré funman at videolan.org
Mon Jan 23 03:42:25 CET 2012


Le 2012-01-22 15:45, Laurent Aimar a écrit :
> On Sun, Jan 22, 2012 at 03:16:25PM -0500, Rafaël Carré wrote:
>> ---
>>  modules/audio_filter/resampler/speex.c |    4 ++++
>>  1 files changed, 4 insertions(+), 0 deletions(-)
>>
>> diff --git a/modules/audio_filter/resampler/speex.c b/modules/audio_filter/resampler/speex.c
>> index cc00e86..c642a49 100644
>> --- a/modules/audio_filter/resampler/speex.c
>> +++ b/modules/audio_filter/resampler/speex.c
>> @@ -104,6 +104,10 @@ static void Close (vlc_object_t *obj)
>>  
>>  static block_t *Resample (filter_t *filter, block_t *in)
>>  {
>> +    /* Check if we really need to run the resampler */
>> +    if( filter->fmt_out.audio.i_rate == filter->fmt_in.audio.i_rate )
>> +        return in;
>> +
>>      SpeexResamplerState *st = (SpeexResamplerState *)filter->p_sys;
>  This will create annoying noises when vlc switch from/to using or not
> the resampler.

Ok,

Any reason speex is so slow when not resampling? Shouldn't it just store
played audio in its context and use them only when actually resampling?



More information about the vlc-devel mailing list