]> git.sesse.net Git - vlc/blobdiff - modules/codec/cmml/cmml.c
macosx: Simplify the title update code.
[vlc] / modules / codec / cmml / cmml.c
index 2ea083562da5cc659fefe19afc45361a303b3fe4..2e5109efcea5c622b55395004ce62890a1fd5516 100644 (file)
@@ -31,7 +31,8 @@
 # include "config.h"
 #endif
 
-#include <vlc/vlc.h>
+#include <vlc_common.h>
+#include <vlc_plugin.h>
 #include <vlc_input.h>
 #include <vlc_codec.h>
 #include <vlc_osd.h>
@@ -62,21 +63,21 @@ static void          ParseText     ( decoder_t *, block_t * );
 /*****************************************************************************
  * Exported prototypes
  *****************************************************************************/
-int  E_(OpenIntf)  ( vlc_object_t * );
-void E_(CloseIntf) ( vlc_object_t * );
+int  OpenIntf  ( vlc_object_t * );
+void CloseIntf ( vlc_object_t * );
 
 /*****************************************************************************
  * Module descriptor.
  *****************************************************************************/
 vlc_module_begin();
-    set_description( _("CMML annotations decoder") );
+    set_description( N_("CMML annotations decoder") );
     set_capability( "decoder", 50 );
     set_callbacks( OpenDecoder, CloseDecoder );
     add_shortcut( "cmml" );
 
     add_submodule();
         set_capability( "interface", 0 );
-        set_callbacks( E_(OpenIntf), E_(CloseIntf) );
+        set_callbacks( OpenIntf, CloseIntf );
 vlc_module_end();
 
 /*****************************************************************************
@@ -107,7 +108,6 @@ static int OpenDecoder( vlc_object_t *p_this )
     if( ( p_dec->p_sys = p_sys =
           (decoder_sys_t *)malloc(sizeof(decoder_sys_t)) ) == NULL )
     {
-        msg_Err( p_dec, "out of memory" );
         return VLC_EGENERIC;
     }
 
@@ -130,7 +130,7 @@ static int OpenDecoder( vlc_object_t *p_this )
     vlc_object_release( p_input );
 
     /* initialise the CMML responder interface */
-    p_sys->p_intf = intf_Create( p_dec, "cmml", 0, NULL );
+    p_sys->p_intf = intf_Create( p_dec, "cmml" );
     intf_RunThread( p_sys->p_intf );
 
     return VLC_SUCCESS;
@@ -188,7 +188,7 @@ static void CloseDecoder( vlc_object_t *p_this )
         intf_StopThread( p_intf );
         vlc_object_detach( p_intf );
         vlc_object_release( p_intf );
-        intf_Destroy( p_intf );
+        vlc_object_release( p_intf );
     }
 
     p_sys->p_intf = NULL;
@@ -291,10 +291,10 @@ static void ParseText( decoder_t *p_dec, block_t *p_block )
 
     }
 
-    if( psz_subtitle ) free( psz_subtitle );
-    if( psz_cmml ) free( psz_cmml );
-    if( p_anchor ) free( p_anchor );
-    if( p_clip_parser ) free( p_clip_parser );
-    if( psz_url ) free( psz_url );
+    free( psz_subtitle );
+    free( psz_cmml );
+    free( p_anchor );
+    free( p_clip_parser );
+    free( psz_url );
 }