[vlc-commits] freetype: keep updating some styles
Francois Cartegnie
git at videolan.org
Tue Dec 6 19:52:20 CET 2016
vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Tue Dec 6 17:37:06 2016 +0100| [98d908f78c970f45f3034a49d4a34607d88a3914] | committer: Francois Cartegnie
freetype: keep updating some styles
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=98d908f78c970f45f3034a49d4a34607d88a3914
---
modules/text_renderer/freetype/freetype.c | 17 +++++++++++++++--
1 file changed, 15 insertions(+), 2 deletions(-)
diff --git a/modules/text_renderer/freetype/freetype.c b/modules/text_renderer/freetype/freetype.c
index 2ef4dc4..ca1f0e8 100644
--- a/modules/text_renderer/freetype/freetype.c
+++ b/modules/text_renderer/freetype/freetype.c
@@ -925,15 +925,26 @@ static inline int RenderAXYZ( filter_t *p_filter,
return VLC_SUCCESS;
}
+static void UpdateDefaultLiveStyles( filter_t *p_filter )
+{
+ text_style_t *p_style = p_filter->p_sys->p_default_style;
+
+ p_style->i_font_color = var_InheritInteger( p_filter, "freetype-color" );
+
+ p_style->i_background_alpha = var_InheritInteger( p_filter, "freetype-background-opacity" );
+ p_style->i_background_color = var_InheritInteger( p_filter, "freetype-background-color" );
+}
+
static void FillDefaultStyles( filter_t *p_filter )
{
filter_sys_t *p_sys = p_filter->p_sys;
+ UpdateDefaultLiveStyles( p_filter );
+
p_sys->p_default_style->psz_fontname = var_InheritString( p_filter, "freetype-font" );
p_sys->p_default_style->psz_monofontname = var_InheritString( p_filter, "freetype-monofont" );
- p_sys->p_default_style->i_font_alpha = var_InheritInteger( p_filter,"freetype-opacity" );
- p_sys->p_default_style->i_font_color = var_InheritInteger( p_filter,"freetype-color" );
+ p_sys->p_default_style->i_font_alpha = var_InheritInteger( p_filter, "freetype-opacity" );
p_sys->p_default_style->i_outline_alpha = var_InheritInteger( p_filter, "freetype-outline-opacity" );
p_sys->p_default_style->i_outline_color = var_InheritInteger( p_filter, "freetype-outline-color" );
@@ -1062,6 +1073,8 @@ static int Render( filter_t *p_filter, subpicture_region_t *p_region_out,
bool b_grid = p_region_in->b_gridmode;
p_sys->i_scale = ( b_grid ) ? 100 : var_InheritInteger( p_filter, "sub-text-scale");
+ UpdateDefaultLiveStyles( p_filter );
+
/*
* Update the default face to reflect changes in video size or text scaling
*/
More information about the vlc-commits
mailing list