int i_samplerate;
int i_channel;
int i_sbr; // 0: no sbr, 1: sbr, -1: unknown
+ int i_ps; // 0: no ps, 1: ps, -1: unknown
struct
{
decoder_t *p_dec = (decoder_t*)p_this;
decoder_sys_t *p_sys;
- if( p_dec->fmt_in.i_codec != VLC_FOURCC( 'm', 'p', '4', 'a' ) )
+ if( p_dec->fmt_in.i_codec != VLC_CODEC_MP4A )
{
return VLC_EGENERIC;
}
/* Set output properties */
p_dec->fmt_out.i_cat = AUDIO_ES;
- p_dec->fmt_out.i_codec = VLC_FOURCC('m','p','4','a');
+ p_dec->fmt_out.i_codec = VLC_CODEC_MP4A;
msg_Dbg( p_dec, "running MPEG4 audio packetizer" );
static int Mpeg4ReadAudioObjectType( bs_t *s )
{
int i_type = bs_read( s, 5 );
- if( i_type == 0x1f )
- i_type += bs_read( s, 6 );
+ if( i_type == 31 )
+ i_type = 32 + bs_read( s, 6 );
return i_type;
}
"ER AAC LTP", "ER AAC Scalable", "ER TwinVQ", "ER BSAC", "ER AAC LD",
"ER CELP", "ER HVXC", "ER HILN", "ER Parametric",
"SSC",
- "Reserved", "Reserved", "Escape",
+ "PS", "Reserved", "Escape",
"Layer 1", "Layer 2", "Layer 3",
"DST",
};
p_cfg->i_channel = -1;
p_cfg->i_sbr = -1;
+ p_cfg->i_ps = -1;
p_cfg->extension.i_object_type = 0;
p_cfg->extension.i_samplerate = 0;
- if( p_cfg->i_object_type == 5 )
+ if( p_cfg->i_object_type == 5 || p_cfg->i_object_type == 29 )
{
p_cfg->i_sbr = 1;
- p_cfg->extension.i_object_type = p_cfg->i_object_type;
+ if( p_cfg->i_object_type == 29 )
+ p_cfg->i_ps = 1;
+ p_cfg->extension.i_object_type = 5;
p_cfg->extension.i_samplerate = Mpeg4ReadAudioSamplerate( s );
p_cfg->i_object_type = Mpeg4ReadAudioObjectType( s );
case 35:
// DSTSpecificConfig();
break;
+ case 36:
+ // ALSSpecificConfig();
+ break;
default:
// error
break;
break;
}
- if( p_cfg->extension.i_object_type != 5 && i_max_size > 0 && i_max_size - (bs_pos(s) - i_pos_start) >= 16 &&
+ if( p_cfg->extension.i_object_type != 5 && i_max_size > 0 && i_max_size - (bs_pos(s) - i_pos_start) >= 16 &&
bs_read( s, 11 ) == 0x2b7 )
{
p_cfg->extension.i_object_type = Mpeg4ReadAudioObjectType( s );
{
p_cfg->i_sbr = bs_read1( s );
if( p_cfg->i_sbr == 1 )
+ {
p_cfg->extension.i_samplerate = Mpeg4ReadAudioSamplerate( s );
+ if( i_max_size > 0 && i_max_size - (bs_pos(s) - i_pos_start) >= 12 && bs_read( s, 11 ) == 0x548 )
+ {
+ p_cfg->i_ps = bs_read1( s );
+ }
+ }
}
}
i_bits = bs_pos(s) - i_pos_start;
- *pi_extra = ( i_bits + 7 ) / 8;
- for( i = 0; i < __MIN( LATM_MAX_EXTRA_SIZE, *pi_extra ); i++ )
+ *pi_extra = __MIN( ( i_bits + 7 ) / 8, LATM_MAX_EXTRA_SIZE );
+ for( i = 0; i < *pi_extra; i++ )
{
const int i_read = __MIN( 8, i_bits - 8*i );
p_extra[i] = bs_read( &s_sav, i_read ) << (8-i_read);
if( (*pp_block)->i_flags&BLOCK_FLAG_CORRUPTED )
{
p_sys->i_state = STATE_NOSYNC;
- block_BytestreamFlush( &p_sys->bytestream );
+ block_BytestreamEmpty( &p_sys->bytestream );
}
- //aout_DateSet( &p_sys->end_date, 0 );
+ aout_DateSet( &p_sys->end_date, 0 );
block_Release( *pp_block );
return NULL;
}