# HG changeset patch # User eugeni # Date 1162752991 0 # Node ID 6ae01628975fe8d4986bfb216e1d313e06653291 # Parent 06145689880c3302f941ecb675991842a5c180b9 Initialize fontconfig in VFCTRL_INIT_EOSD handler. Recent libass api changes moved fontconfig initialization to filter's config() function. It is bad, because cache update can take a long time, resulting in unpleasant sound effects. This change restores the original behaviour. diff -r 06145689880c -r 6ae01628975f libass/ass_mp.c --- a/libass/ass_mp.c Sun Nov 05 18:53:21 2006 +0000 +++ b/libass/ass_mp.c Sun Nov 05 18:56:31 2006 +0000 @@ -211,12 +211,14 @@ char *get_path(char *); void ass_configure(ass_renderer_t* priv, int w, int h) { - char *dir, *path, *family; ass_set_frame_size(priv, w, h); ass_set_margins(priv, ass_top_margin, ass_bottom_margin, 0, 0); ass_set_use_margins(priv, ass_use_margins); ass_set_font_scale(priv, ass_font_scale); +} +void ass_configure_fonts(ass_renderer_t* priv) { + char *dir, *path, *family; dir = get_path("fonts"); if (!font_fontconfig && font_name) path = strdup(font_name); else path = get_path("subfont.ttf"); diff -r 06145689880c -r 6ae01628975f libass/ass_mp.h --- a/libass/ass_mp.h Sun Nov 05 18:53:21 2006 +0000 +++ b/libass/ass_mp.h Sun Nov 05 18:56:31 2006 +0000 @@ -41,6 +41,7 @@ ass_track_t* ass_read_subdata(ass_library_t* library, sub_data* subdata, double fps); void ass_configure(ass_renderer_t* priv, int w, int h); +void ass_configure_fonts(ass_renderer_t* priv); ass_library_t* ass_init(); #endif diff -r 06145689880c -r 6ae01628975f libmpcodecs/vf_ass.c --- a/libmpcodecs/vf_ass.c Sun Nov 05 18:53:21 2006 +0000 +++ b/libmpcodecs/vf_ass.c Sun Nov 05 18:56:31 2006 +0000 @@ -350,7 +350,9 @@ switch (request) { case VFCTRL_INIT_EOSD: vf->priv->ass_priv = ass_renderer_init((ass_library_t*)data); - return vf->priv->ass_priv ? CONTROL_TRUE : CONTROL_FALSE; + if (!vf->priv->ass_priv) return CONTROL_FALSE; + ass_configure_fonts(vf->priv->ass_priv); + return CONTROL_TRUE; case VFCTRL_DRAW_EOSD: if (vf->priv->ass_priv) return CONTROL_TRUE; break; diff -r 06145689880c -r 6ae01628975f libmpcodecs/vf_vo.c --- a/libmpcodecs/vf_vo.c Sun Nov 05 18:53:21 2006 +0000 +++ b/libmpcodecs/vf_vo.c Sun Nov 05 18:56:31 2006 +0000 @@ -109,6 +109,7 @@ { vf->priv->ass_priv = ass_renderer_init((ass_library_t*)data); if (!vf->priv->ass_priv) return CONTROL_FALSE; + ass_configure_fonts(vf->priv->ass_priv); return CONTROL_TRUE; } case VFCTRL_DRAW_EOSD: