decoder_sys_t *p_sys = p_dec->p_sys;
faacDecConfiguration *cfg;
- 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;
}
/* Allocate the memory needed to store the decoder's structure */
- if( ( p_dec->p_sys = p_sys =
- (decoder_sys_t *)malloc(sizeof(decoder_sys_t)) ) == NULL )
+ if( ( p_dec->p_sys = p_sys = malloc( sizeof(*p_sys) ) ) == NULL )
return VLC_ENOMEM;
/* Open a faad context */
p_dec->fmt_out.i_cat = AUDIO_ES;
if (vlc_CPU() & CPU_CAPABILITY_FPU)
- p_dec->fmt_out.i_codec = VLC_FOURCC('f','l','3','2');
+ p_dec->fmt_out.i_codec = VLC_CODEC_FL32;
else
p_dec->fmt_out.i_codec = AOUT_FMT_S16_NE;
p_dec->pf_decode_audio = DecodeBlock;
p_dec->fmt_in.i_extra,
&i_rate, &i_channels ) < 0 )
{
+ msg_Err( p_dec, "Failed to initialize faad using extra data" );
return VLC_EGENERIC;
}
= pi_channels_guessed[frame.channels];
/* Adjust stream info when dealing with SBR/PS */
- if( (p_sys->b_sbr != frame.sbr || p_sys->b_ps != frame.ps) &&
- p_dec->p_parent->i_object_type == VLC_OBJECT_INPUT )
+ if( p_sys->b_sbr != frame.sbr || p_sys->b_ps != frame.ps )
{
- input_thread_t *p_input = (input_thread_t *)p_dec->p_parent;
- char *psz_cat;
const char *psz_ext = (frame.sbr && frame.ps) ? "SBR+PS" :
frame.sbr ? "SBR" : "PS";
msg_Dbg( p_dec, "AAC %s (channels: %u, samplerate: %lu)",
psz_ext, frame.channels, frame.samplerate );
- if( asprintf( &psz_cat, _("Stream %d"), p_dec->fmt_in.i_id ) != -1 )
- {
- input_Control( p_input, INPUT_ADD_INFO, psz_cat,
- _("AAC extension"), "%s", psz_ext );
- input_Control( p_input, INPUT_ADD_INFO, psz_cat,
- _("Channels"), "%d", frame.channels );
- input_Control( p_input, INPUT_ADD_INFO, psz_cat,
- _("Sample rate"), _("%d Hz"), frame.samplerate );
- free( psz_cat );
- }
+ if( !p_dec->p_description )
+ p_dec->p_description = vlc_meta_New();
+ if( p_dec->p_description )
+ vlc_meta_AddExtra( p_dec->p_description, _("AAC extension"), psz_ext );
+
p_sys->b_sbr = frame.sbr; p_sys->b_ps = frame.ps;
}