[vlc-devel] commit: freetype.c: use var_CreateGet for variables (Ilkka Ollakka )

git version control git at videolan.org
Mon Jul 27 10:56:53 CEST 2009


vlc | branch: master | Ilkka Ollakka <ileoo at videolan.org> | Mon Jul 27 11:54:59 2009 +0300| [25b52afe4a89f1daa87f2ed17ada1ae69d3935d0] | committer: Ilkka Ollakka 

freetype.c: use var_CreateGet for variables

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

 modules/misc/freetype.c |   28 ++++++++--------------------
 1 files changed, 8 insertions(+), 20 deletions(-)

diff --git a/modules/misc/freetype.c b/modules/misc/freetype.c
index 972845b..0dc3143 100644
--- a/modules/misc/freetype.c
+++ b/modules/misc/freetype.c
@@ -301,7 +301,6 @@ static int Create( vlc_object_t *p_this )
     FcResult       fontresult;
 #endif
 
-    vlc_value_t    val;
 
     /* Allocate structure */
     p_filter->p_sys = p_sys = malloc( sizeof( filter_sys_t ) );
@@ -312,29 +311,18 @@ static int Create( vlc_object_t *p_this )
     p_sys->i_font_size = 0;
     p_sys->i_display_height = 0;
 
-    var_Create( p_filter, "freetype-font",
-                VLC_VAR_STRING | VLC_VAR_DOINHERIT );
-    var_Create( p_filter, "freetype-fontsize",
-                VLC_VAR_INTEGER | VLC_VAR_DOINHERIT );
     var_Create( p_filter, "freetype-rel-fontsize",
                 VLC_VAR_INTEGER | VLC_VAR_DOINHERIT );
-    var_Create( p_filter, "freetype-opacity",
-                VLC_VAR_INTEGER | VLC_VAR_DOINHERIT );
-    var_Create( p_filter, "freetype-effect",
-                VLC_VAR_INTEGER | VLC_VAR_DOINHERIT );
-    var_Get( p_filter, "freetype-opacity", &val );
-    p_sys->i_font_opacity = __MAX( __MIN( val.i_int, 255 ), 0 );
-    var_Create( p_filter, "freetype-color",
-                VLC_VAR_INTEGER | VLC_VAR_DOINHERIT );
-    var_Get( p_filter, "freetype-color", &val );
-    p_sys->i_font_color = __MAX( __MIN( val.i_int, 0xFFFFFF ), 0 );
-    p_sys->i_effect = var_GetInteger( p_filter, "freetype-effect" );
-    var_Get( p_filter, "freetype-fontsize", &val );
-    p_sys->i_default_font_size = val.i_int;
+
+    psz_fontfamily = var_CreateGetString( p_filter, "freetype-font" );
+    p_sys->i_default_font_size = var_CreateGetInteger( p_filter, "freetype-fontsize" );
+    p_sys->i_effect = var_CreateGetInteger( p_filter, "freetype-effect" );
+    p_sys->i_font_opacity = var_CreateGetInteger( p_filter,"freetype-opacity" );
+    p_sys->i_font_opacity = __MAX( __MIN( p_sys->i_font_opacity, 255 ), 0 );
+    p_sys->i_font_color = var_CreateGetInteger( p_filter, "freetype-color" );
+    p_sys->i_font_color = __MAX( __MIN( p_sys->i_font_color , 0xFFFFFF ), 0 );
 
     fontindex=0;
-    var_Get( p_filter, "freetype-font", &val );
-    psz_fontfamily = val.psz_string;
     if( !psz_fontfamily || !*psz_fontfamily )
     {
 #ifdef HAVE_FONTCONFIG




More information about the vlc-devel mailing list