summaryrefslogtreecommitdiffstats
path: root/sub/ass_mp.c
diff options
context:
space:
mode:
authorFrédéric Brière <fbriere@fbriere.net>2022-02-10 21:36:34 -0500
committerDudemanguy <random342@airmail.cc>2023-03-01 02:09:46 +0000
commit779d4f99a74cce2089f0bf7dc5ed10c7a7ff00a3 (patch)
tree15a744a8531e7151a33d0cd3681f54eb41444940 /sub/ass_mp.c
parent022790a2b49e4d21cb803842cb54958cca9c732e (diff)
downloadmpv-779d4f99a74cce2089f0bf7dc5ed10c7a7ff00a3.tar.bz2
mpv-779d4f99a74cce2089f0bf7dc5ed10c7a7ff00a3.tar.xz
sub: add --sub-fonts-dir and --osd-fonts-dir options
These options make it possible to specify the directory that will be passed to ass_set_fonts_dir(), akin to VLC's `--ssa-fontsdir` and FFmpeg's `fontsdir`. Fixes #8338
Diffstat (limited to 'sub/ass_mp.c')
-rw-r--r--sub/ass_mp.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/sub/ass_mp.c b/sub/ass_mp.c
index 8d0ab96e7d..634681f2ec 100644
--- a/sub/ass_mp.c
+++ b/sub/ass_mp.c
@@ -132,9 +132,12 @@ static void message_callback(int level, const char *format, va_list va, void *ct
mp_msg(log, level, "\n");
}
-ASS_Library *mp_ass_init(struct mpv_global *global, struct mp_log *log)
+ASS_Library *mp_ass_init(struct mpv_global *global,
+ struct osd_style_opts *opts, struct mp_log *log)
{
- char *path = mp_find_config_file(NULL, global, "fonts");
+ char *path = opts->fonts_dir && opts->fonts_dir[0] ?
+ mp_get_user_path(NULL, global, opts->fonts_dir) :
+ mp_find_config_file(NULL, global, "fonts");
mp_dbg(log, "ASS library version: 0x%x (runtime 0x%x)\n",
(unsigned)LIBASS_VERSION, ass_library_version());
ASS_Library *priv = ass_library_init();