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

Laurent Aimar fenrir at elivagar.org
Sun Jan 22 21:45:16 CET 2012


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.

-- 
fenrir



More information about the vlc-devel mailing list