]> git.sesse.net Git - vlc/blobdiff - modules/video_output/image.c
Fix a compilation warning.
[vlc] / modules / video_output / image.c
index 9c7edbcba2400555977c4c3d1dcba6f87de1b88a..05f8891039b72843d578bed12cfb3b8c82ec5af3 100644 (file)
@@ -29,7 +29,8 @@
 # include "config.h"
 #endif
 
-#include <vlc/vlc.h>
+#include <vlc_common.h>
+#include <vlc_plugin.h>
 #include <vlc_vout.h>
 #include <vlc_interface.h>
 
@@ -76,14 +77,14 @@ static void Display   ( vout_thread_t *, picture_t * );
                             "creating one file per image. In this case, " \
                              "the number is not appended to the filename." )
 
-static const char *psz_format_list[] = { "png", "jpeg" };
-static const char *psz_format_list_text[] = { "PNG", "JPEG" };
+static const char *const psz_format_list[] = { "png", "jpeg" };
+static const char *const psz_format_list_text[] = { "PNG", "JPEG" };
 
 #define CFG_PREFIX "image-out-"
 
 vlc_module_begin( );
-    set_shortname( _( "Image file" ) );
-    set_description( _( "Image video output" ) );
+    set_shortname( N_( "Image file" ) );
+    set_description( N_( "Image video output" ) );
     set_category( CAT_VIDEO );
     set_subcategory( SUBCAT_VIDEO_VOUT );
     set_capability( "video output", 0 );
@@ -106,7 +107,7 @@ vlc_module_begin( );
     set_callbacks( Create, Destroy );
 vlc_module_end();
 
-static const char *ppsz_vout_options[] = {
+static const char *const ppsz_vout_options[] = {
     "format", "width", "height", "ratio", "prefix", "replace", NULL
 };
 
@@ -314,6 +315,9 @@ static void Display( vout_thread_t *p_vout, picture_t *p_pic )
         psz_prefix = psz_tmp;
     psz_filename = (char *)malloc( 10 + strlen( psz_prefix )
                                       + strlen( p_vout->p_sys->psz_format ) );
+    if( !psz_filename )
+        return;
+
     if( p_vout->p_sys->b_replace )
     {
         sprintf( psz_filename, "%s.%s", psz_prefix,