diff options
author | Ricardo Constantino <wiiaboo@gmail.com> | 2015-08-30 23:52:10 +0100 |
---|---|---|
committer | wm4 <nfxjfg@googlemail.com> | 2015-09-02 00:47:52 +0200 |
commit | 9dbc50b4cdaf6de5a4d52bdaa3d4d1a0df5efadd (patch) | |
tree | c3148ac9c4016387b56ed3e65182654a25d30e64 /libavfilter/vf_subtitles.c | |
parent | 642d2f9d558b946de6a92f2fad32286e74e14218 (diff) |
avfilter/vf_subtitles: allow setting fonts directory
This is mostly useful if libass was compiled with a font provider
other than fontconfig, but is still useful in that case.
Signed-off-by: Ricardo Constantino <wiiaboo@gmail.com>
Diffstat (limited to 'libavfilter/vf_subtitles.c')
-rw-r--r-- | libavfilter/vf_subtitles.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/libavfilter/vf_subtitles.c b/libavfilter/vf_subtitles.c index 5e1324c715..b0d016c0e5 100644 --- a/libavfilter/vf_subtitles.c +++ b/libavfilter/vf_subtitles.c @@ -50,6 +50,7 @@ typedef struct { ASS_Renderer *renderer; ASS_Track *track; char *filename; + char *fontsdir; char *charenc; char *force_style; int stream_index; @@ -67,6 +68,7 @@ typedef struct { {"filename", "set the filename of file to read", OFFSET(filename), AV_OPT_TYPE_STRING, {.str = NULL}, CHAR_MIN, CHAR_MAX, FLAGS }, \ {"f", "set the filename of file to read", OFFSET(filename), AV_OPT_TYPE_STRING, {.str = NULL}, CHAR_MIN, CHAR_MAX, FLAGS }, \ {"original_size", "set the size of the original video (used to scale fonts)", OFFSET(original_w), AV_OPT_TYPE_IMAGE_SIZE, {.str = NULL}, CHAR_MIN, CHAR_MAX, FLAGS }, \ + {"fontsdir", "set the directory containing the fonts to read", OFFSET(fontsdir), AV_OPT_TYPE_STRING, {.str = NULL}, CHAR_MIN, CHAR_MAX, FLAGS }, \ /* libass supports a log level ranging from 0 to 7 */ static const int ass_libavfilter_log_level_map[] = { @@ -106,6 +108,8 @@ static av_cold int init(AVFilterContext *ctx) } ass_set_message_cb(ass->library, ass_log, ctx); + ass_set_fonts_dir(ass->library, ass->fontsdir); + ass->renderer = ass_renderer_init(ass->library); if (!ass->renderer) { av_log(ctx, AV_LOG_ERROR, "Could not initialize libass renderer.\n"); |