Commit 08feb323 authored by Tristan Matthews's avatar Tristan Matthews

speex: deduce mode from rate when decoding rtp

Fixes #5178
parent 1a9bda43
...@@ -650,9 +650,12 @@ static block_t *DecodeRtpSpeexPacket( decoder_t *p_dec, block_t **pp_block ) ...@@ -650,9 +650,12 @@ static block_t *DecodeRtpSpeexPacket( decoder_t *p_dec, block_t **pp_block )
msg_Err( p_dec, "Could not allocate a Speex header."); msg_Err( p_dec, "Could not allocate a Speex header.");
return NULL; 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 ); 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 ) if ( !p_sys->p_state )
{ {
msg_Err( p_dec, "Could not allocate a Speex decoder." ); msg_Err( p_dec, "Could not allocate a Speex decoder." );
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment