]> git.sesse.net Git - vlc/blobdiff - modules/demux/subtitle.c
Don't print a message a malloc failed.
[vlc] / modules / demux / subtitle.c
index af09d58889fd1eec914c51e8344dec2ab49660d4..f7b9ae3a488446db350851f491a2c4e90fa2ce95 100644 (file)
@@ -31,7 +31,7 @@
 # include "config.h"
 #endif
 
-#include <vlc/vlc.h>
+#include <vlc_common.h>
 #include <vlc_plugin.h>
 #include <vlc_input.h>
 
@@ -62,7 +62,7 @@ static void Close( vlc_object_t *p_this );
     "\"mpsub\", \"jacosub\", \"psb\", \"realtext\", \"dks\", \"subviewer1\", " \
     " and \"auto\" (meaning autodetection, this should always work).")
 
-static const char *ppsz_sub_type[] =
+static const char *const ppsz_sub_type[] =
 {
     "auto", "microdvd", "subrip", "subviewer", "ssa1",
     "ssa2-4", "ass", "vplayer", "sami", "dvdsubtitle", "mpl2",
@@ -253,7 +253,7 @@ static int Open ( vlc_object_t *p_this )
     /* Get or probe the type */
     p_sys->i_type = SUB_TYPE_UNKNOWN;
     psz_type = var_CreateGetString( p_demux, "sub-type" );
-    if( *psz_type )
+    if( psz_type && *psz_type )
     {
         int i;
 
@@ -449,7 +449,6 @@ static int Open ( vlc_object_t *p_this )
             if( !( p_sys->subtitle = realloc( p_sys->subtitle,
                                               sizeof(subtitle_t) * i_max ) ) )
             {
-                msg_Err( p_demux, "out of memory");
                 free( p_sys->subtitle );
                 TextUnload( &p_sys->txt );
                 free( p_sys );