summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoreugeni <eugeni@b3059339-0415-0410-9bf9-f77b7e298cf2>2006-08-24 15:36:20 +0000
committereugeni <eugeni@b3059339-0415-0410-9bf9-f77b7e298cf2>2006-08-24 15:36:20 +0000
commit43a971a720985fc0d9adc5d3572573f6f001ba6b (patch)
treee03c4e8aa9ebdc86a8b6958e4717b0464f7c4220
parentfffeb2311b478da7bf357c8280863148f9a244be (diff)
downloadmpv-43a971a720985fc0d9adc5d3572573f6f001ba6b.tar.bz2
mpv-43a971a720985fc0d9adc5d3572573f6f001ba6b.tar.xz
Simplify vf_ass initialization.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@19523 b3059339-0415-0410-9bf9-f77b7e298cf2
-rw-r--r--libass/ass_render.c10
-rw-r--r--libmpcodecs/vf_ass.c7
2 files changed, 8 insertions, 9 deletions
diff --git a/libass/ass_render.c b/libass/ass_render.c
index 327f886b19..8f961e61a8 100644
--- a/libass/ass_render.c
+++ b/libass/ass_render.c
@@ -178,20 +178,20 @@ ass_instance_t* ass_init(void)
if (family) free(family);
if (!fc_priv)
- return 0;
+ goto ass_init_exit;
error = FT_Init_FreeType( &ft );
if ( error ) {
mp_msg(MSGT_GLOBAL, MSGL_FATAL, "FT_Init_FreeType failed\n");
fontconfig_done(fc_priv);
- return 0;
+ goto ass_init_exit;
}
priv = calloc(1, sizeof(ass_instance_t));
if (!priv) {
FT_Done_FreeType(ft);
fontconfig_done(fc_priv);
- return 0;
+ goto ass_init_exit;
}
priv->library = ft;
priv->fontconfig_priv = fc_priv;
@@ -202,6 +202,10 @@ ass_instance_t* ass_init(void)
text_info.glyphs = calloc(MAX_GLYPHS, sizeof(glyph_info_t));
+ass_init_exit:
+ if (priv) mp_msg(MSGT_GLOBAL, MSGL_INFO, "[ass] Init\n");
+ else mp_msg(MSGT_GLOBAL, MSGL_ERR, "[ass] Init failed\n");
+
return priv;
}
diff --git a/libmpcodecs/vf_ass.c b/libmpcodecs/vf_ass.c
index a4ba0e534e..f3163da5fb 100644
--- a/libmpcodecs/vf_ass.c
+++ b/libmpcodecs/vf_ass.c
@@ -357,12 +357,7 @@ static int control(vf_instance_t *vf, int request, void *data)
{
if (request == VFCTRL_EOSD) {
vf->priv->ass_priv = ass_init();
- if (!vf->priv->ass_priv) {
- mp_msg(MSGT_VFILTER, MSGL_ERR, "[ass] Init failed\n");
- return 0;
- } else
- mp_msg(MSGT_VFILTER, MSGL_INFO, "[ass] Init\n");
- return CONTROL_TRUE;
+ return vf->priv->ass_priv ? CONTROL_TRUE : CONTROL_FALSE;
}
return vf_next_control(vf, request, data);
}