# include "config.h"
#endif
-#include <vlc/vlc.h>
+#include <vlc_common.h>
+#include <vlc_plugin.h>
#include <vlc_codec.h>
#include "spudec.h"
static int PacketizerOpen( vlc_object_t * );
static void Close ( vlc_object_t * );
-vlc_module_begin();
- set_description( _("DVD subtitles decoder") );
- set_capability( "decoder", 50 );
- set_category( CAT_INPUT );
- set_subcategory( SUBCAT_INPUT_SCODEC );
- set_callbacks( DecoderOpen, Close );
+vlc_module_begin ()
+ set_description( N_("DVD subtitles decoder") )
+ set_capability( "decoder", 50 )
+ set_category( CAT_INPUT )
+ set_subcategory( SUBCAT_INPUT_SCODEC )
+ set_callbacks( DecoderOpen, Close )
- add_submodule();
- set_description( _("DVD subtitles packetizer") );
- set_capability( "packetizer", 50 );
- set_callbacks( PacketizerOpen, Close );
-vlc_module_end();
+ add_submodule ()
+ set_description( N_("DVD subtitles packetizer") )
+ set_capability( "packetizer", 50 )
+ set_callbacks( PacketizerOpen, Close )
+vlc_module_end ()
/*****************************************************************************
* Local prototypes
decoder_t *p_dec = (decoder_t*)p_this;
decoder_sys_t *p_sys;
- if( p_dec->fmt_in.i_codec != VLC_FOURCC( 's','p','u',' ' ) &&
- p_dec->fmt_in.i_codec != VLC_FOURCC( 's','p','u','b' ) )
- {
+ if( p_dec->fmt_in.i_codec != VLC_CODEC_SPU )
return VLC_EGENERIC;
- }
p_dec->p_sys = p_sys = malloc( sizeof( decoder_sys_t ) );
p_sys->i_spu = 0;
p_sys->p_block = NULL;
- es_format_Init( &p_dec->fmt_out, SPU_ES, VLC_FOURCC( 's','p','u',' ' ) );
+ es_format_Init( &p_dec->fmt_out, SPU_ES, VLC_CODEC_SPU );
p_dec->pf_decode_sub = Decode;
p_dec->pf_packetize = NULL;
p_dec->pf_packetize = Packetize;
p_dec->p_sys->b_packetizer = true;
es_format_Copy( &p_dec->fmt_out, &p_dec->fmt_in );
- p_dec->fmt_out.i_codec = VLC_FOURCC( 's','p','u',' ' );
+ p_dec->fmt_out.i_codec = VLC_CODEC_SPU;
return VLC_SUCCESS;
}
block_ChainRelease( p_spu_block );
/* Parse and decode */
- p_spu = E_(ParsePacket)( p_dec );
+ p_spu = ParsePacket( p_dec );
/* reinit context */
p_sys->i_spu_size = 0;
( p_block->i_pts <= 0 || p_block->i_buffer < 4 ) )
{
msg_Dbg( p_dec, "invalid starting packet (size < 4 or pts <=0)" );
- msg_Dbg( p_dec, "spu size: %d, i_pts: "I64Fd" i_buffer: %d",
+ msg_Dbg( p_dec, "spu size: %d, i_pts: %"PRId64" i_buffer: %zu",
p_sys->i_spu_size, p_block->i_pts, p_block->i_buffer );
block_Release( p_block );
return NULL;