[vlc-commits] codec: libass: add additional fonts dir option
Francois Cartegnie
git at videolan.org
Fri Jan 22 22:16:29 UTC 2021
vlc/vlc-3.0 | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Wed Jan 20 22:52:33 2021 +0100| [b370823e9a9ac6bdf9deced685939864d578f078] | committer: Francois Cartegnie
codec: libass: add additional fonts dir option
(cherry picked from commit 4298d6310c840e56b4b4b590bc727aff608cfab3)
> http://git.videolan.org/gitweb.cgi/vlc/vlc-3.0.git/?a=commit;h=b370823e9a9ac6bdf9deced685939864d578f078
---
modules/codec/libass.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/modules/codec/libass.c b/modules/codec/libass.c
index 3e3eb548b4..ac03830e3c 100644
--- a/modules/codec/libass.c
+++ b/modules/codec/libass.c
@@ -56,6 +56,8 @@
static int Create ( vlc_object_t * );
static void Destroy( vlc_object_t * );
+#define TEXT_SSA_FONTSDIR N_("Additional fonts directory")
+
vlc_module_begin ()
set_shortname( N_("Subtitles (advanced)"))
set_description( N_("Subtitle renderers using libass") )
@@ -63,6 +65,7 @@ vlc_module_begin ()
set_category( CAT_INPUT )
set_subcategory( SUBCAT_INPUT_SCODEC )
set_callbacks( Create, Destroy )
+ add_string("ssa-fontsdir", NULL, TEXT_SSA_FONTSDIR, NULL, false)
vlc_module_end ()
/*****************************************************************************
@@ -213,6 +216,13 @@ static int Create( vlc_object_t *p_this )
}
free( pp_attachments );
+ char *psz_fontsdir = var_InheritString( p_dec, "ssa-fontsdir" );
+ if( psz_fontsdir )
+ {
+ ass_set_fonts_dir( p_library, psz_fontsdir );
+ free( psz_fontsdir );
+ }
+
ass_set_extract_fonts( p_library, true );
ass_set_style_overrides( p_library, NULL );
More information about the vlc-commits
mailing list