aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-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: