]> git.sesse.net Git - vlc/blobdiff - modules/misc/win32text.c
No need to do stat() before opendir()!
[vlc] / modules / misc / win32text.c
index 5b6fa4c30ba21afba8016d3ce32df8389270b9ee..322d42a0f6e8f4a5e5436d2dc5662607d4557cf3 100644 (file)
 /*****************************************************************************
  * Preamble
  *****************************************************************************/
-#include <stdlib.h>                                      /* malloc(), free() */
-#include <string.h>
+
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
 
 #include <vlc/vlc.h>
+#include <vlc_plugin.h>
 #include <vlc_vout.h>
 #include <vlc_osd.h>
 #include <vlc_block.h>
@@ -54,11 +57,10 @@ static int SetFont( filter_t *, int );
 #define FONT_TEXT N_("Font")
 #define FONT_LONGTEXT N_("Filename for the font you want to use")
 #define FONTSIZE_TEXT N_("Font size in pixels")
-/// \bug [String] extra space
 #define FONTSIZE_LONGTEXT N_("This is the default size of the fonts " \
      "that will be rendered on the video. " \
      "If set to something different than 0 this option will override the " \
-     "relative font size. " )
+     "relative font size." )
 #define OPACITY_TEXT N_("Opacity")
 #define OPACITY_LONGTEXT N_("The opacity (inverse of transparency) of the " \
      "text that will be rendered on the video. 0 = transparent, " \
@@ -93,19 +95,19 @@ vlc_module_begin();
     set_subcategory( SUBCAT_VIDEO_SUBPIC );
 
     add_integer( "win32text-fontsize", 0, NULL, FONTSIZE_TEXT,
-                 FONTSIZE_LONGTEXT, VLC_TRUE );
+                 FONTSIZE_LONGTEXT, true );
 
     /* opacity valid on 0..255, with default 255 = fully opaque */
     add_integer_with_range( "win32-opacity", 255, 0, 255, NULL,
-        OPACITY_TEXT, OPACITY_LONGTEXT, VLC_FALSE );
+        OPACITY_TEXT, OPACITY_LONGTEXT, false );
 
     /* hook to the color values list, with default 0x00ffffff = white */
     add_integer( "win32text-color", 0x00FFFFFF, NULL, COLOR_TEXT,
-                 COLOR_LONGTEXT, VLC_TRUE );
+                 COLOR_LONGTEXT, true );
         change_integer_list( pi_color_values, ppsz_color_descriptions, 0 );
 
     add_integer( "win32text-rel-fontsize", 16, NULL, FONTSIZER_TEXT,
-                 FONTSIZER_LONGTEXT, VLC_FALSE );
+                 FONTSIZER_LONGTEXT, false );
         change_integer_list( pi_sizes, ppsz_sizes_text, 0 );
 
     set_capability( "text renderer", 50 );
@@ -182,13 +184,13 @@ static int Create( vlc_object_t *p_this )
     p_sys->i_default_font_size = val.i_int;
     if( SetFont( p_filter, 0 ) != VLC_SUCCESS ) goto error;
 
-    if( psz_fontfile ) free( psz_fontfile );
+    free( psz_fontfile );
     p_filter->pf_render_text = RenderText;
     p_filter->pf_render_html = NULL;
     return VLC_SUCCESS;
 
  error:
-    if( psz_fontfile ) free( psz_fontfile );
+    free( psz_fontfile );
     free( p_sys );
     return VLC_EGENERIC;
 }
@@ -219,7 +221,7 @@ static int Render( filter_t *p_filter, subpicture_region_t *p_region,
     video_format_t fmt;
     int i, i_pitch;
     subpicture_region_t *p_region_tmp;
-    vlc_bool_t b_outline = VLC_TRUE;
+    bool b_outline = true;
 
     /* Create a new subpicture region */
     memset( &fmt, 0, sizeof(video_format_t) );