aboutsummaryrefslogtreecommitdiffhomepage
path: root/libmpcodecs
diff options
context:
space:
mode:
authorGravatar eugeni <eugeni@b3059339-0415-0410-9bf9-f77b7e298cf2>2006-10-26 20:08:46 +0000
committerGravatar eugeni <eugeni@b3059339-0415-0410-9bf9-f77b7e298cf2>2006-10-26 20:08:46 +0000
commite8733cbf9d0355eed05d04e2f8c010ac8282c203 (patch)
tree969c21238acca16c5df5243bda0313c00255f43d /libmpcodecs
parent702278b69ea590cfbacbcf92a48a17d5b5309c0c (diff)
Split ass_configure() into several smaller functions.
FontConfig initialization moved from ass_init() to ass_set_fonts(). git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@20462 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libmpcodecs')
-rw-r--r--libmpcodecs/vf_ass.c15
-rw-r--r--libmpcodecs/vf_vo.c22
2 files changed, 8 insertions, 29 deletions
diff --git a/libmpcodecs/vf_ass.c b/libmpcodecs/vf_ass.c
index 46273d47c6..922f268b0a 100644
--- a/libmpcodecs/vf_ass.c
+++ b/libmpcodecs/vf_ass.c
@@ -77,8 +77,6 @@ static int config(struct vf_instance_s* vf,
int width, int height, int d_width, int d_height,
unsigned int flags, unsigned int outfmt)
{
- ass_settings_t settings;
-
if (outfmt == IMGFMT_IF09) return 0;
vf->priv->outh = height + ass_top_margin + ass_bottom_margin;
@@ -94,17 +92,8 @@ static int config(struct vf_instance_s* vf,
vf->priv->dirty_rows = malloc(vf->priv->outh);
if (vf->priv->ass_priv) {
- memset(&settings, 0, sizeof(ass_settings_t));
- settings.frame_width = vf->priv->outw;
- settings.frame_height = vf->priv->outh;
- settings.font_size_coeff = ass_font_scale;
- settings.line_spacing = ass_line_spacing;
- settings.top_margin = ass_top_margin;
- settings.bottom_margin = ass_bottom_margin;
- settings.use_margins = ass_use_margins;
- settings.aspect = ((double)d_width) / d_height;
-
- ass_configure(vf->priv->ass_priv, &settings);
+ ass_configure(vf->priv->ass_priv, vf->priv->outw, vf->priv->outh);
+ ass_set_aspect_ratio(vf->priv->ass_priv, ((double)d_width) / d_height);
}
return vf_next_config(vf, vf->priv->outw, vf->priv->outh, d_width, d_height, flags, outfmt);
diff --git a/libmpcodecs/vf_vo.c b/libmpcodecs/vf_vo.c
index 7ef32e40a1..56b6f02d45 100644
--- a/libmpcodecs/vf_vo.c
+++ b/libmpcodecs/vf_vo.c
@@ -30,7 +30,6 @@ struct vf_priv_s {
vf_vo_data_t* vf_vo_data;
#ifdef USE_ASS
ass_instance_t* ass_priv;
- ass_settings_t ass_settings;
#endif
};
#define video_out (vf->priv->vf_vo_data->vo)
@@ -70,11 +69,8 @@ static int config(struct vf_instance_s* vf,
return 0;
#ifdef USE_ASS
- if (vf->priv->ass_priv) {
- vf->priv->ass_settings.font_size_coeff = ass_font_scale;
- vf->priv->ass_settings.line_spacing = ass_line_spacing;
- vf->priv->ass_settings.use_margins = ass_use_margins;
- }
+ if (vf->priv->ass_priv)
+ ass_configure(vf->priv->ass_priv, width, height);
#endif
++vo_config_count;
@@ -112,7 +108,8 @@ static int control(struct vf_instance_s* vf, int request, void* data)
case VFCTRL_INIT_EOSD:
{
vf->priv->ass_priv = ass_init();
- return vf->priv->ass_priv ? CONTROL_TRUE : CONTROL_FALSE;
+ if (!vf->priv->ass_priv) return CONTROL_FALSE;
+ return CONTROL_TRUE;
}
case VFCTRL_DRAW_EOSD:
{
@@ -121,18 +118,11 @@ static int control(struct vf_instance_s* vf, int request, void* data)
if (!vo_config_count || !vf->priv->ass_priv) return CONTROL_FALSE;
if (sub_visibility && vf->priv->ass_priv && ass_track && (pts != MP_NOPTS_VALUE)) {
mp_eosd_res_t res;
- ass_settings_t* const settings = &vf->priv->ass_settings;
memset(&res, 0, sizeof(res));
if (video_out->control(VOCTRL_GET_EOSD_RES, &res) == VO_TRUE) {
- settings->frame_width = res.w;
- settings->frame_height = res.h;
- settings->top_margin = res.mt;
- settings->bottom_margin = res.mb;
- settings->left_margin = res.ml;
- settings->right_margin = res.mr;
- settings->aspect = ((double)res.w) / res.h;
+ ass_set_frame_size(vf->priv->ass_priv, res.w, res.h);
+ ass_set_margins(vf->priv->ass_priv, res.mt, res.mb, res.ml, res.mr);
}
- ass_configure(vf->priv->ass_priv, settings);
images = ass_render_frame(vf->priv->ass_priv, ass_track, (pts+sub_delay) * 1000 + .5);
}