[vlc-commits] freetype: store forced chroma, no re-read
Francois Cartegnie
git at videolan.org
Wed Aug 26 10:45:55 CEST 2020
vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Tue Aug 25 17:11:00 2020 +0200| [bf38cd15988938f3fbf530a1168415dbcf9e9f8b] | committer: Francois Cartegnie
freetype: store forced chroma, no re-read
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=bf38cd15988938f3fbf530a1168415dbcf9e9f8b
---
modules/text_renderer/freetype/freetype.c | 5 ++++-
modules/text_renderer/freetype/freetype.h | 2 ++
2 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/modules/text_renderer/freetype/freetype.c b/modules/text_renderer/freetype/freetype.c
index 252383d82e..2ecddc56b0 100644
--- a/modules/text_renderer/freetype/freetype.c
+++ b/modules/text_renderer/freetype/freetype.c
@@ -1234,7 +1234,7 @@ static int Render( filter_t *p_filter, subpicture_region_t *p_region_out,
if( (unsigned)i_margin * 2 >= i_max_width || (unsigned)i_margin * 2 >= i_max_height )
i_margin = 0;
- if( var_InheritBool( p_filter, "freetype-yuvp" ) )
+ if( p_sys->i_forced_chroma == VLC_CODEC_YUVP )
p_chroma_list = p_chroma_list_yuvp;
else if( !p_chroma_list || *p_chroma_list == 0 )
p_chroma_list = p_chroma_list_rgba;
@@ -1415,6 +1415,9 @@ static int Create( vlc_object_t *p_this )
/* fills default and forced style */
FillDefaultStyles( p_filter );
+ if( var_InheritBool( p_filter, "freetype-yuvp" ) )
+ p_sys->i_forced_chroma = VLC_CODEC_YUVP;
+
/*
* The following variables should not be cached, as they might be changed on-the-fly:
* freetype-rel-fontsize, freetype-background-opacity, freetype-background-color,
diff --git a/modules/text_renderer/freetype/freetype.h b/modules/text_renderer/freetype/freetype.h
index 7d3e9784a8..ee69304ab9 100644
--- a/modules/text_renderer/freetype/freetype.h
+++ b/modules/text_renderer/freetype/freetype.h
@@ -113,6 +113,8 @@ typedef struct
int i_font_default_size;
int i_outline_thickness;
+ vlc_fourcc_t i_forced_chroma;
+
vlc_font_select_t *fs;
vlc_ftcache_t *ftcache;
More information about the vlc-commits
mailing list