encoder_sys_t *p_sys;
/* FIXME: what about layers 1 and 2 ? shine is an 'MP3' encoder */
- if( p_enc->fmt_out.i_codec != VLC_FOURCC('m','p','3',' ') ||
+ if( p_enc->fmt_out.i_codec != VLC_CODEC_MP3 ||
p_enc->fmt_out.audio.i_channels > 2 )
return VLC_EGENERIC;
p_enc->fmt_out.i_bitrate, p_enc->fmt_out.audio.i_rate,
p_enc->fmt_out.audio.i_channels );
- p_sys = p_enc->p_sys = malloc( sizeof( encoder_sys_t ) );
+ p_enc->p_sys = p_sys = calloc( 1, sizeof( *p_sys ) );
if( !p_sys )
return VLC_ENOMEM;
- memset( p_sys, 0, sizeof( encoder_sys_t ) );
if( !( p_sys->p_fifo = block_FifoNew() ) )
{
p_enc->fmt_out.audio.i_channels, p_enc->fmt_out.i_bitrate / 1000 );
p_enc->pf_encode_audio = EncodeFrame;
+ p_enc->fmt_out.i_cat = AUDIO_ES;
return VLC_SUCCESS;
}
static block_t *EncodeFrame( encoder_t *p_enc, aout_buffer_t *p_block )
{
- encoder_sys_t *p_sys = (encoder_sys_t *)p_enc->p_sys;
block_t *p_pcm_block;
block_t *p_chain = NULL;
unsigned int i_samples = p_block->i_nb_bytes >> 2 /* s16l stereo */;
mtime_t start_date = p_block->start_date;
start_date -= (mtime_t)i_samples * (mtime_t)1000000 / (mtime_t)p_enc->fmt_out.audio.i_rate;
+ VLC_UNUSED(p_enc);
+
do {
p_pcm_block = GetPCM( p_enc, p_block );
if( !p_pcm_block )