From b711624ef350d1e971f5fcc57eb4af9f74233d2a Mon Sep 17 00:00:00 2001 From: Uoti Urpala Date: Sat, 14 Apr 2012 03:51:19 +0300 Subject: subs: only use "subfont.ttf" as libass fallback if it exists Libass was set to use the file "subfont.ttf" in the user configuration directory as a default/fallback font. This triggered "Error opening font" errors from libass if it tried to use the fallback font for some glyph and the user had not copied/linked any font there (and there is generally little reason to do that nowadays when using fontconfig). Check whether the path exists and only set it in ass_set_fonts() if it does. --- sub/ass_mp.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'sub') diff --git a/sub/ass_mp.c b/sub/ass_mp.c index 8af3698a47..0713248db0 100644 --- a/sub/ass_mp.c +++ b/sub/ass_mp.c @@ -266,8 +266,13 @@ void mp_ass_configure_fonts(ASS_Renderer *priv) path = strdup(sub_font_name); else if (font_fontconfig < 0 && font_name) path = strdup(font_name); - else + else { path = get_path("subfont.ttf"); + if (!mp_path_exists(path)) { + free(path); + path = NULL; + } + } if (font_fontconfig >= 0 && sub_font_name) family = strdup(sub_font_name); else if (font_fontconfig >= 0 && font_name) -- cgit v1.2.3