[vlc-devel] [PATCH] speex: deduce mode from rate when decoding rtp

Jean-Baptiste Kempf jb at videolan.org
Mon Apr 21 16:52:02 CEST 2014


On 21 Apr, Tristan Matthews wrote :
> Fixes #5178

LGTM.

> ---
>  modules/codec/speex.c | 7 +++++--
>  1 file changed, 5 insertions(+), 2 deletions(-)
> 
> diff --git a/modules/codec/speex.c b/modules/codec/speex.c
> index 488b9c2..b840082 100644
> --- a/modules/codec/speex.c
> +++ b/modules/codec/speex.c
> @@ -582,9 +582,12 @@ static block_t *DecodeRtpSpeexPacket( decoder_t *p_dec, block_t **pp_block )
>              msg_Err( p_dec, "Could not allocate a Speex header.");
>              return NULL;
>          }
> -        speex_init_header( p_sys->p_header,p_sys->rtp_rate,1,&speex_nb_mode );
> +
> +        const SpeexMode *mode = speex_lib_get_mode((p_sys->rtp_rate / 8000) >> 1);
> +
> +        speex_init_header( p_sys->p_header,p_sys->rtp_rate, 1, mode );
>              speex_bits_init( &p_sys->bits );
> -        p_sys->p_state = speex_decoder_init( &speex_nb_mode );
> +        p_sys->p_state = speex_decoder_init( mode );
>          if ( !p_sys->p_state )
>          {
>              msg_Err( p_dec, "Could not allocate a Speex decoder." );
> -- 
> 1.9.1
> 
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> https://mailman.videolan.org/listinfo/vlc-devel

-- 
With my kindest regards,

-- 
Jean-Baptiste Kempf
http://www.jbkempf.com/ - +33 672 704 734
Sent from my Electronic Device



More information about the vlc-devel mailing list