]> git.sesse.net Git - vlc/blobdiff - modules/misc/freetype.c
legacy OS X intf: fixed playlist table view as hinted by Derk-Jan
[vlc] / modules / misc / freetype.c
index ca49cbc7499ab2b583c40b134c34243af9e370b6..278e7b4087995789f7ccb7f25d02a2b0c6501495 100644 (file)
@@ -114,7 +114,7 @@ static void Destroy( vlc_object_t * );
 #define FONTSIZER_TEXT N_("Relative font size")
 #define FONTSIZER_LONGTEXT N_("This is the relative default size of the " \
     "fonts that will be rendered on the video. If absolute font size is set, "\
-    "relative size will be overriden." )
+    "relative size will be overridden." )
 
 static const int pi_sizes[] = { 20, 18, 16, 12, 6 };
 static const char *const ppsz_sizes_text[] = {
@@ -355,7 +355,7 @@ static int Create( vlc_object_t *p_this )
     dialog_progress_bar_t *p_dialog = dialog_ProgressCreate( p_filter,
             _("Building font cache"),
             _("Please wait while your font cache is rebuilt.\n"
-                "This should take less than few minutes."), NULL );
+                "This should take less than few minutes."), NULL );
     char *path = xmalloc( PATH_MAX + 1 );
     /* Fontconfig doesnt seem to know where windows fonts are with
      * current contribs. So just tell default windows font directory
@@ -436,6 +436,7 @@ static int Create( vlc_object_t *p_this )
     {
         dialog_ProgressSet( p_dialog, NULL, 1.0 );
         dialog_ProgressDestroy( p_dialog );
+        p_dialog = NULL;
     }
 # endif
 
@@ -505,6 +506,12 @@ error:
     if( fontmatch ) FcPatternDestroy( fontmatch );
     if( fontpattern ) FcPatternDestroy( fontpattern );
 #endif
+
+#ifdef WIN32
+    if( p_dialog )
+        dialog_ProgressDestroy( p_dialog );
+#endif
+
     if( p_sys->p_face ) FT_Done_Face( p_sys->p_face );
     if( p_sys->p_library ) FT_Done_FreeType( p_sys->p_library );
     free( psz_fontfamily );
@@ -638,6 +645,7 @@ static int Render( filter_t *p_filter, subpicture_region_t *p_region,
     p_region->p_picture = picture_NewFromFormat( &fmt );
     if( !p_region->p_picture )
         return VLC_EGENERIC;
+    fmt.p_palette = p_region->fmt.p_palette ? p_region->fmt.p_palette : malloc(sizeof(*fmt.p_palette));
     p_region->fmt = fmt;
 
     /* Calculate text color components */
@@ -1348,7 +1356,7 @@ static int RenderText( filter_t *p_filter, subpicture_region_t *p_region_out,
     p_region_out->i_x = p_region_in->i_x;
     p_region_out->i_y = p_region_in->i_y;
 
-    if( config_GetInt( p_filter, "freetype-yuvp" ) )
+    if( var_InheritBool( p_filter, "freetype-yuvp" ) )
         Render( p_filter, p_region_out, p_lines, result.x, result.y );
     else
         RenderYUVA( p_filter, p_region_out, p_lines, result.x, result.y );
@@ -2320,7 +2328,7 @@ static int RenderHtml( filter_t *p_filter, subpicture_region_t *p_region_out,
                      */
                     if(( rv == VLC_SUCCESS ) && ( i_len > 0 ))
                     {
-                        if( config_GetInt( p_filter, "freetype-yuvp" ) )
+                        if( var_InheritBool( p_filter, "freetype-yuvp" ) )
                         {
                             Render( p_filter, p_region_out, p_lines,
                                     result.x, result.y );