]> git.sesse.net Git - vlc/blobdiff - modules/codec/spudec/spudec.c
Merge commit 'origin/1.0-bugfix'
[vlc] / modules / codec / spudec / spudec.c
index 95842f985d0bdd9185bb3aababb8133c74613102..bd9be5d3fb2d0b8276bc60be1b18c6e12afa9d4e 100644 (file)
@@ -29,7 +29,8 @@
 # include "config.h"
 #endif
 
-#include <vlc/vlc.h>
+#include <vlc_common.h>
+#include <vlc_plugin.h>
 #include <vlc_codec.h>
 
 #include "spudec.h"
@@ -41,18 +42,18 @@ static int  DecoderOpen   ( vlc_object_t * );
 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
@@ -72,11 +73,8 @@ static int DecoderOpen( vlc_object_t *p_this )
     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 ) );
 
@@ -85,7 +83,7 @@ static int DecoderOpen( vlc_object_t *p_this )
     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;
@@ -110,7 +108,7 @@ static int PacketizerOpen( vlc_object_t *p_this )
     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;
 }
@@ -153,7 +151,7 @@ static subpicture_t *Decode( decoder_t *p_dec, block_t **pp_block )
     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;
@@ -205,7 +203,7 @@ static block_t *Reassemble( decoder_t *p_dec, block_t **pp_block )
         ( 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;