1
0
mirror of https://github.com/mpv-player/mpv synced 2024-12-24 15:52:25 +00:00

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
This commit is contained in:
eugeni 2006-11-05 18:56:31 +00:00
parent 722581780f
commit aca2396794
4 changed files with 8 additions and 2 deletions

View File

@ -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");

View File

@ -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

View File

@ -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;

View File

@ -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: