quartztext: fontsizes of <=0 are not useful. use 12 as fallback.
authorDerk-Jan Hartman <hartman@videolan.org>
Fri, 26 Jun 2009 12:54:06 +0000 (14:54 +0200)
committerDerk-Jan Hartman <hartman@videolan.org>
Fri, 26 Jun 2009 14:17:16 +0000 (16:17 +0200)
This fixes using marq and rss filter with default options on Mac OS X.

modules/misc/quartztext.c

index 4e80fa8..ea05219 100644 (file)
@@ -423,6 +423,15 @@ static int RenderText( filter_t *p_filter, subpicture_region_t *p_region_out,
 
     if( !i_font_alpha ) i_font_alpha = 255 - p_sys->i_font_opacity;
 
+    if( i_font_size <= 0 )
+    {
+        msg_Warn( p_filter, "invalid fontsize, using 12" );
+        if( VLC_SUCCESS == var_Get( p_filter, "scale", &val ))
+            i_font_size = 12 * val.i_int / 1000;
+        else
+            i_font_size = 12;
+    }
+
     ConvertToUTF16( EliminateCRLF( psz_string ), &i_string_length, &psz_utf16_str );
 
     p_region_out->i_x = p_region_in->i_x;