From 61d45a940d518479fa8bf7fceaf641a04e4a0731 Mon Sep 17 00:00:00 2001 From: eugeni Date: Tue, 19 Sep 2006 13:06:44 +0000 Subject: [PATCH] Don't call FcDirScan/FcDirSave with FontConfig >= 2.4. Font cache is updated automatically in FcConfigAppFontAddDir. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@19907 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libass/ass_fontconfig.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libass/ass_fontconfig.c b/libass/ass_fontconfig.c index 3c1ea61148..53dfd17335 100644 --- a/libass/ass_fontconfig.c +++ b/libass/ass_fontconfig.c @@ -154,9 +154,11 @@ fc_instance_t* fontconfig_init(const char* dir, const char* family, const char* if (FcDirCacheValid((const FcChar8 *)dir) == FcFalse) { + mp_msg(MSGT_GLOBAL, MSGL_INFO, "[ass] Updating font cache\n"); + // FontConfig >= 2.4.0 updates cache automatically in FcConfigAppFontAddDir() + if (FcGetVersion() < 20400) { FcFontSet* fcs; FcStrSet* fss; - mp_msg(MSGT_GLOBAL, MSGL_INFO, "[ass] Updating font cache\n"); fcs = FcFontSetCreate(); fss = FcStrSetCreate(); rc = FcStrSetAdd(fss, (const FcChar8*)dir); @@ -178,6 +180,7 @@ fc_instance_t* fontconfig_init(const char* dir, const char* family, const char* } ErrorFontCache: ; + } } rc = FcConfigAppFontAddDir(priv->config, (const FcChar8*)dir);