[vlc-devel] commit: quartztext: fontsizes of <=0 are not useful. use 12 as fallback. ( Derk-Jan Hartman )

git version control git at videolan.org
Fri Jun 26 17:11:10 CEST 2009


vlc | branch: 1.0-bugfix | Derk-Jan Hartman <hartman at videolan.org> | Fri Jun 26 14:54:06 2009 +0200| [5071bd0bd5e8344d1f05c4e9807b44ae63ce55e0] | committer: Derk-Jan Hartman 

quartztext: fontsizes of <=0 are not useful. use 12 as fallback.

This fixes using marq and rss filter with default options on Mac OS X.
(cherry picked from commit 770f625ac99dc365e25a89906b235ecdd5a3d23a)

Signed-off-by: Derk-Jan Hartman <hartman at videolan.org>

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=5071bd0bd5e8344d1f05c4e9807b44ae63ce55e0
---

 modules/misc/quartztext.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/modules/misc/quartztext.c b/modules/misc/quartztext.c
index b65ab64..9f73138 100644
--- a/modules/misc/quartztext.c
+++ b/modules/misc/quartztext.c
@@ -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;




More information about the vlc-devel mailing list