aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar eugeni <eugeni@b3059339-0415-0410-9bf9-f77b7e298cf2>2006-11-05 18:56:31 +0000
committerGravatar eugeni <eugeni@b3059339-0415-0410-9bf9-f77b7e298cf2>2006-11-05 18:56:31 +0000
commitaca23967944e3e0d43f66e56ad9ef57e0a1e8684 (patch)
tree174c905c8e32f7a4b071ebcb675eef61a3495a71
parent722581780feea52a838d13e6d16fc920c0251ff4 (diff)
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. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@20722 b3059339-0415-0410-9bf9-f77b7e298cf2
-rw-r--r--libass/ass_mp.c4
-rw-r--r--libass/ass_mp.h1
-rw-r--r--libmpcodecs/vf_ass.c4
-rw-r--r--libmpcodecs/vf_vo.c1
4 files changed, 8 insertions, 2 deletions
diff --git a/libass/ass_mp.c b/libass/ass_mp.c
index 87e3123c4f..a4d195ffad 100644
--- a/libass/ass_mp.c
+++ b/libass/ass_mp.c
@@ -211,12 +211,14 @@ ass_track_t* ass_read_subdata(ass_library_t* library, sub_data* subdata, double
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 --git a/libass/ass_mp.h b/libass/ass_mp.h
index abe67a9d3c..28c83b6a02 100644
--- a/libass/ass_mp.h
+++ b/libass/ass_mp.h
@@ -41,6 +41,7 @@ int ass_process_subtitle(ass_track_t* track, subtitle* sub);
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 --git a/libmpcodecs/vf_ass.c b/libmpcodecs/vf_ass.c
index fc2c06b4fc..3fed4f159c 100644
--- a/libmpcodecs/vf_ass.c
+++ b/libmpcodecs/vf_ass.c
@@ -350,7 +350,9 @@ static int control(vf_instance_t *vf, int request, void *data)
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 --git a/libmpcodecs/vf_vo.c b/libmpcodecs/vf_vo.c
index b8e35543cc..f44d21d8e3 100644
--- a/libmpcodecs/vf_vo.c
+++ b/libmpcodecs/vf_vo.c
@@ -109,6 +109,7 @@ static int control(struct vf_instance_s* vf, int request, void* data)
{
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: