From 26190dbe579833ab0a5d5ccc754a908af94fbda0 Mon Sep 17 00:00:00 2001 From: wm4 Date: Tue, 25 Nov 2014 11:08:25 +0100 Subject: player: add option not to use OSD/fontconfig Makeshift-solution for working around certain fontconfig issues. With --use-text-osd=no, libass and fontconfig won't be initialized, and fontconfig won't block everything with scanning for fonts. --- DOCS/man/options.rst | 10 ++++++++++ options/options.c | 2 ++ options/options.h | 1 + sub/osd_libass.c | 3 +++ 4 files changed, 16 insertions(+) diff --git a/DOCS/man/options.rst b/DOCS/man/options.rst index 226259b2c2..a9d007813a 100644 --- a/DOCS/man/options.rst +++ b/DOCS/man/options.rst @@ -2496,6 +2496,16 @@ OSD Default: 0. +``--use-text-osd=`` + Disable text OSD rendering completely. (This includes the complete OSC as + well.) This is mostly useful for avoiding loading fontconfig in situations + where fontconfig does not behave well, and OSD is unused - this could for + example allow GUI programs using libmpv to workaround fontconfig issues. + + Note that selecting subtitles of any kind still initializes fontconfig. + + Default: ``no``. + Screenshot ---------- diff --git a/options/options.c b/options/options.c index 7f78d884a6..3327b206e1 100644 --- a/options/options.c +++ b/options/options.c @@ -351,6 +351,7 @@ const m_option_t mp_opts[] = { OPT_FLOATRANGE("osd-bar-w", osd_bar_w, 0, 1, 100), OPT_FLOATRANGE("osd-bar-h", osd_bar_h, 0, 0.1, 50), OPT_SUBSTRUCT("osd", osd_style, osd_style_conf, 0), + OPT_FLAG("use-text-osd", use_text_osd, CONF_GLOBAL), OPT_SUBSTRUCT("sub-text", sub_text_style, osd_style_conf, 0), OPT_FLAG("sub-clear-on-seek", sub_clear_on_seek, 0), @@ -610,6 +611,7 @@ const struct MPOpts mp_default_opts = { .osd_bar_h = 3.125, .osd_scale = 1, .osd_scale_by_window = 1, + .use_text_osd = 1, #if HAVE_LUA .lua_load_osc = 1, .lua_load_ytdl = 0, diff --git a/options/options.h b/options/options.h index 752d1f4801..dadcb0800a 100644 --- a/options/options.h +++ b/options/options.h @@ -224,6 +224,7 @@ typedef struct MPOpts { char **sub_name; char **sub_paths; int sub_auto; + int use_text_osd; int osd_bar_visible; float osd_bar_align_x; float osd_bar_align_y; diff --git a/sub/osd_libass.c b/sub/osd_libass.c index 3275cc59e6..573a373a06 100644 --- a/sub/osd_libass.c +++ b/sub/osd_libass.c @@ -471,6 +471,9 @@ static void update_object(struct osd_state *osd, struct osd_object *obj) void osd_object_get_bitmaps(struct osd_state *osd, struct osd_object *obj, struct sub_bitmaps *out_imgs) { + if (!osd->opts->use_text_osd) + return; + if (obj->force_redraw) update_object(osd, obj); -- cgit v1.2.3