@ -62,7 +62,7 @@ struct decoder_sys_t
mtime_t i_pts ;
int i_frame_size , i_free_frame_size ;
unsigned int i_channels_conf , i_channels ;
unsigned int i_channels_conf , i_chan_mode , i_chan nels ;
unsigned int i_rate , i_max_frame_size , i_frame_length ;
unsigned int i_layer , i_bit_rate ;
@ -128,9 +128,8 @@ static uint8_t *GetOutBuffer( decoder_t *p_dec, block_t **pp_out_buffer )
p_dec - > fmt_out . audio . i_frame_length = p_sys - > i_frame_length ;
p_dec - > fmt_out . audio . i_bytes_per_frame = p_sys - > i_max_frame_size ;
p_dec - > fmt_out . audio . i_original_channels = p_sys - > i_channels_conf ;
p_dec - > fmt_out . audio . i_physical_channels =
p_sys - > i_channels_conf & AOUT_CHAN_PHYSMASK ;
p_dec - > fmt_out . audio . i_physical_channels = p_sys - > i_channels_conf ;
p_dec - > fmt_out . audio . i_chan_mode = p_sys - > i_chan_mode ;
p_dec - > fmt_out . i_bitrate = p_sys - > i_bit_rate * 1000 ;
@ -151,6 +150,7 @@ static uint8_t *GetOutBuffer( decoder_t *p_dec, block_t **pp_out_buffer )
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
static int SyncInfo ( uint32_t i_header , unsigned int * pi_channels ,
unsigned int * pi_channels_conf ,
unsigned int * pi_chan_mode ,
unsigned int * pi_sample_rate , unsigned int * pi_bit_rate ,
unsigned int * pi_frame_length ,
unsigned int * pi_max_frame_size , unsigned int * pi_layer )
@ -205,6 +205,7 @@ static int SyncInfo( uint32_t i_header, unsigned int * pi_channels,
i_mode = ( i_header & 0xc0 ) > > 6 ;
/* Modeext, copyright & original */
i_emphasis = i_header & 0x3 ;
* pi_chan_mode = 0 ;
if ( * pi_layer ! = 4 & &
i_bitrate_index < 0x0f & &
@ -213,16 +214,14 @@ static int SyncInfo( uint32_t i_header, unsigned int * pi_channels,
{
switch ( i_mode )
{
case 2 : /* dual-mono */
* pi_chan_mode = AOUT_CHANMODE_DUALMONO ;
/* fall through */
case 0 : /* stereo */
case 1 : /* joint stereo */
* pi_channels = 2 ;
* pi_channels_conf = AOUT_CHAN_LEFT | AOUT_CHAN_RIGHT ;
break ;
case 2 : /* dual-mono */
* pi_channels = 2 ;
* pi_channels_conf = AOUT_CHAN_LEFT | AOUT_CHAN_RIGHT
| AOUT_CHAN_DUALMONO ;
break ;
case 3 : /* mono */
* pi_channels = 1 ;
* pi_channels_conf = AOUT_CHAN_CENTER ;
@ -379,6 +378,7 @@ static block_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
p_sys - > i_frame_size = SyncInfo ( i_header ,
& p_sys - > i_channels ,
& p_sys - > i_channels_conf ,
& p_sys - > i_chan_mode ,
& p_sys - > i_rate ,
& p_sys - > i_bit_rate ,
& p_sys - > i_frame_length ,
@ -427,7 +427,7 @@ static block_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
{
/* Startcode is fine, let's try the header as an extra check */
int i_next_frame_size ;
unsigned int i_next_channels , i_next_channels_conf ;
unsigned int i_next_channels , i_next_stereo_mode , i_next_ channels_conf ;
unsigned int i_next_rate , i_next_bit_rate ;
unsigned int i_next_frame_length , i_next_max_frame_size ;
unsigned int i_next_layer ;
@ -438,6 +438,7 @@ static block_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
i_next_frame_size = SyncInfo ( i_header ,
& i_next_channels ,
& i_next_channels_conf ,
& i_next_stereo_mode ,
& i_next_rate ,
& i_next_bit_rate ,
& i_next_frame_length ,
@ -473,6 +474,7 @@ static block_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
/* Check info is in sync with previous one */
if ( i_next_channels_conf ! = p_sys - > i_channels_conf | |
i_next_stereo_mode ! = p_sys - > i_chan_mode | |
i_next_rate ! = p_sys - > i_rate | |
i_next_layer ! = p_sys - > i_layer | |
i_next_frame_length ! = p_sys - > i_frame_length )
@ -630,9 +632,9 @@ static int Open( vlc_object_t *p_this )
p_sys - > b_discontinuity = false ;
p_sys - > i_frame_size = 0 ;
p_sys - > i_channels_conf = p_sys - > i_channels = p_sys - > i_rate =
p_sys - > i_max_frame_size = p_sys - > i_frame_length = p_sys - > i_layer =
p_sys - > i_bit_rate = 0 ;
p_sys - > i_channels_conf = p_sys - > i_chan_mode = p_sys - > i_channels =
p_sys - > i_rate = p_sys - > i_ max_frame_size = p_sys - > i_frame_length =
p_sys - > i_layer = p_sys - > i_ bit_rate = 0 ;
/* Set output properties */
p_dec - > fmt_out . i_codec = VLC_CODEC_MPGA ;