diff options
author | Uoti Urpala <uau@mplayer2.org> | 2012-04-14 03:51:19 +0300 |
---|---|---|
committer | Uoti Urpala <uau@mplayer2.org> | 2012-04-14 03:51:19 +0300 |
commit | b711624ef350d1e971f5fcc57eb4af9f74233d2a (patch) | |
tree | 25ffa99da2946af9c406a5e1bb3a025fc7296b0e /sub/ass_mp.c | |
parent | 4680beb6dc0cb923cc6bc654e23dd3e007fda413 (diff) | |
download | mpv-b711624ef350d1e971f5fcc57eb4af9f74233d2a.tar.bz2 mpv-b711624ef350d1e971f5fcc57eb4af9f74233d2a.tar.xz |
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.
Diffstat (limited to 'sub/ass_mp.c')
-rw-r--r-- | sub/ass_mp.c | 7 |
1 files changed, 6 insertions, 1 deletions
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) |