[MPlayer-cvslog] r20722 - in trunk: libass/ass_mp.c libass/ass_mp.h libmpcodecs/vf_ass.c libmpcodecs/vf_vo.c

eugeni subversion at mplayerhq.hu
Sun Nov 5 19:56:31 CET 2006


Author: eugeni
Date: Sun Nov  5 19:56:31 2006
New Revision: 20722

Modified:
   trunk/libass/ass_mp.c
   trunk/libass/ass_mp.h
   trunk/libmpcodecs/vf_ass.c
   trunk/libmpcodecs/vf_vo.c

Log:
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.


Modified: trunk/libass/ass_mp.c
==============================================================================
--- trunk/libass/ass_mp.c	(original)
+++ trunk/libass/ass_mp.c	Sun Nov  5 19:56:31 2006
@@ -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");

Modified: trunk/libass/ass_mp.h
==============================================================================
--- trunk/libass/ass_mp.h	(original)
+++ trunk/libass/ass_mp.h	Sun Nov  5 19:56:31 2006
@@ -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

Modified: trunk/libmpcodecs/vf_ass.c
==============================================================================
--- trunk/libmpcodecs/vf_ass.c	(original)
+++ trunk/libmpcodecs/vf_ass.c	Sun Nov  5 19:56:31 2006
@@ -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;

Modified: trunk/libmpcodecs/vf_vo.c
==============================================================================
--- trunk/libmpcodecs/vf_vo.c	(original)
+++ trunk/libmpcodecs/vf_vo.c	Sun Nov  5 19:56:31 2006
@@ -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:



More information about the MPlayer-cvslog mailing list