# include "config.h"
#endif
-#include <vlc/vlc.h>
+#include <vlc_common.h>
#include <vlc_plugin.h>
#include <vlc_codec.h>
#include <vlc_aout.h>
-#include <vlc_input.h>
#include <vlc_block_helper.h>
unsigned int i_layer, i_bit_rate;
bool b_discontinuity;
-
- int i_input_rate;
};
enum {
/*****************************************************************************
* Module descriptor
*****************************************************************************/
-vlc_module_begin();
- set_description( _("MPEG audio layer I/II/III decoder") );
- set_category( CAT_INPUT );
- set_subcategory( SUBCAT_INPUT_ACODEC );
+vlc_module_begin ()
+ set_description( N_("MPEG audio layer I/II/III decoder") )
+ set_category( CAT_INPUT )
+ set_subcategory( SUBCAT_INPUT_ACODEC )
#if defined(UNDER_CE)
- set_capability( "decoder", 5 );
+ set_capability( "decoder", 5 )
#else
- set_capability( "decoder", 100 );
+ set_capability( "decoder", 100 )
#endif
- set_callbacks( OpenDecoder, CloseDecoder );
+ set_callbacks( OpenDecoder, CloseDecoder )
- add_submodule();
- set_description( _("MPEG audio layer I/II/III packetizer") );
- set_capability( "packetizer", 10 );
- set_callbacks( OpenPacketizer, CloseDecoder );
-vlc_module_end();
+ add_submodule ()
+ set_description( N_("MPEG audio layer I/II/III packetizer") )
+ set_capability( "packetizer", 10 )
+ set_callbacks( OpenPacketizer, CloseDecoder )
+vlc_module_end ()
/*****************************************************************************
* OpenDecoder: probe the decoder and return score
/* HACK: Don't use this codec if we don't have an mpga audio filter */
if( p_dec->i_object_type == VLC_OBJECT_DECODER &&
- !module_Exists( p_this, "mpgatofixed32" ) )
+ !module_exists( "mpgatofixed32" ) )
{
return VLC_EGENERIC;
}
aout_DateSet( &p_sys->end_date, 0 );
p_sys->bytestream = block_BytestreamInit();
p_sys->b_discontinuity = false;
- p_sys->i_input_rate = INPUT_RATE_DEFAULT;
/* Set output properties */
p_dec->fmt_out.i_cat = AUDIO_ES;
return NULL;
}
- if( (*pp_block)->i_rate > 0 )
- p_sys->i_input_rate = (*pp_block)->i_rate;
-
block_BytestreamPush( &p_sys->bytestream, *pp_block );
while( 1 )
decoder_sys_t *p_sys = p_dec->p_sys;
aout_buffer_t *p_buf;
- p_buf = p_dec->pf_aout_buffer_new( p_dec, p_sys->i_frame_length );
+ p_buf = decoder_NewAudioBuffer( p_dec, p_sys->i_frame_length );
if( p_buf == NULL ) return NULL;
p_buf->start_date = aout_DateGet( &p_sys->end_date );
p_buf->end_date =
- aout_DateIncrement( &p_sys->end_date,
- p_sys->i_frame_length * p_sys->i_input_rate / INPUT_RATE_DEFAULT );
+ aout_DateIncrement( &p_sys->end_date, p_sys->i_frame_length );
p_buf->b_discontinuity = p_sys->b_discontinuity;
p_sys->b_discontinuity = false;
p_block->i_pts = p_block->i_dts = aout_DateGet( &p_sys->end_date );
p_block->i_length =
- aout_DateIncrement( &p_sys->end_date,
- p_sys->i_frame_length * p_sys->i_input_rate / INPUT_RATE_DEFAULT ) -
- p_block->i_pts;
+ aout_DateIncrement( &p_sys->end_date, p_sys->i_frame_length ) - p_block->i_pts;
return p_block;
}