]> git.sesse.net Git - vlc/blobdiff - modules/codec/realaudio.c
Don't workaround unknown bugs in external libraries
[vlc] / modules / codec / realaudio.c
index c956fc2f55a9e4ac381ba6846d2502e7a4b28da8..1eb45e08877f27cf83b485cef1ec756d8747147d 100644 (file)
 /*****************************************************************************
  * Preamble
  *****************************************************************************/
-#include <vlc/vlc.h>
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#include <vlc_common.h>
+#include <vlc_plugin.h>
 #include <vlc_aout.h>
 #include <vlc_codec.h>
 
@@ -57,7 +62,7 @@ static int  Open ( vlc_object_t * );
 static void Close( vlc_object_t * );
 
 vlc_module_begin();
-    set_description( _("RealAudio library decoder") );
+    set_description( N_("RealAudio library decoder") );
     set_capability( "decoder", 10 );
     set_category( CAT_INPUT );
     set_subcategory( SUBCAT_INPUT_VCODEC );
@@ -196,6 +201,8 @@ static int Open( vlc_object_t *p_this )
     }
 
     p_dec->p_sys = p_sys = malloc( sizeof( decoder_sys_t ) );
+    if( !p_sys )
+        return VLC_ENOMEM;
     memset( p_sys, 0, sizeof(decoder_sys_t) );
 
     /* Flavor for SIPR codecs */
@@ -231,6 +238,11 @@ static int Open( vlc_object_t *p_this )
     p_dec->pf_decode_audio = Decode;
 
     p_sys->p_out = malloc( 4096 * 10 );
+    if( !p_sys->p_out )
+    {
+        free( p_sys );
+        return VLC_ENOMEM;
+    }
     p_sys->i_out = 0;
 
     return VLC_SUCCESS;
@@ -244,7 +256,7 @@ static void Close( vlc_object_t *p_this )
     decoder_t *p_dec = (decoder_t*)p_this;
 
     CloseDll( p_dec );
-    if( p_dec->p_sys->p_out ) free( p_dec->p_sys->p_out );
+    free( p_dec->p_sys->p_out );
     free( p_dec->p_sys );
 }
 
@@ -645,7 +657,7 @@ static aout_buffer_t *Decode( decoder_t *p_dec, block_t **pp_block )
         if( OpenDll( p_dec ) != VLC_SUCCESS )
         {
             /* Fatal */
-            p_dec->b_error = VLC_TRUE;
+            p_dec->b_error = true;
             return NULL;
         }
     }