]> git.sesse.net Git - vlc/blobdiff - modules/codec/cdg.c
Fix memleaks.
[vlc] / modules / codec / cdg.c
index a7695d046e67a701cb9a40c7b31b96f42c89b379..af912284ef4be3e4db7d6a55ba35137fb467eec1 100644 (file)
@@ -2,7 +2,7 @@
  * cdg.c: CDG decoder module
  *****************************************************************************
  * Copyright (C) 2007 Laurent Aimar
- * $Id$
+ * $Id$
  *
  * Authors: Laurent Aimar <fenrir # via.ecp.fr>
  *
 /*****************************************************************************
  * Preamble
  *****************************************************************************/
-#include <vlc/vlc.h>
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#include <vlc_common.h>
+#include <vlc_plugin.h>
 #include <vlc_codec.h>
 #include <vlc_vout.h>
 
@@ -78,7 +83,7 @@ static int Render( decoder_sys_t *p_cdg, picture_t *p_picture );
 vlc_module_begin();
     set_category( CAT_INPUT );
     set_subcategory( SUBCAT_INPUT_VCODEC );
-    set_description( _("CDG video decoder") );
+    set_description( N_("CDG video decoder") );
     set_capability( "decoder", 1000 );
     set_callbacks( Open, Close );
     add_shortcut( "cdg" );
@@ -98,10 +103,7 @@ static int Open( vlc_object_t *p_this )
     /* Allocate the memory needed to store the decoder's structure */
     p_dec->p_sys = p_sys = malloc(sizeof(decoder_sys_t));
     if( !p_sys )
-    {
-        msg_Err( p_dec, "out of memory" );
-        return VLC_EGENERIC;
-    }
+        return VLC_ENOMEM;
 
     /* Init */
     memset( p_sys, 0, sizeof(*p_sys) );
@@ -190,8 +192,9 @@ static void ScreenFill( decoder_sys_t *p_cdg, int sx, int sy, int dx, int dy, in
 static int DecodeMemoryPreset( decoder_sys_t *p_cdg, const uint8_t *p_data )
 {
     const int i_color = p_data[0]&0x0f;
+#if 0
     const int i_repeat= p_data[1]&0x0f;
-
+#endif
     /* if i_repeat > 0 we could ignore it if we have a reliable stream */
     ScreenFill( p_cdg, 0, 0, CDG_SCREEN_WIDTH, CDG_SCREEN_HEIGHT, i_color );
     return 0;