From 5cbce43341551c4f235d3aea959f7d4d38d8f952 Mon Sep 17 00:00:00 2001 From: greg Date: Tue, 9 Feb 2010 17:36:24 +0000 Subject: [PATCH] libass: fix PAR correction git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30530 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libmpcodecs/vf_ass.c | 4 ++-- libmpcodecs/vf_vo.c | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/libmpcodecs/vf_ass.c b/libmpcodecs/vf_ass.c index 3f5d6e352e..738d1b2574 100644 --- a/libmpcodecs/vf_ass.c +++ b/libmpcodecs/vf_ass.c @@ -95,9 +95,9 @@ static int config(struct vf_instance_s* vf, if (vf->priv->ass_priv) { ass_configure(vf->priv->ass_priv, vf->priv->outw, vf->priv->outh, 0); #if defined(LIBASS_VERSION) && LIBASS_VERSION >= 0x00908000 - ass_set_aspect_ratio(vf->priv->ass_priv, ((double)d_width) / d_height, ((double)width) / height); + ass_set_aspect_ratio(vf->priv->ass_priv, 1, 1); #else - ass_set_aspect_ratio(vf->priv->ass_priv, ((double)d_width) / d_height); + ass_set_aspect_ratio(vf->priv->ass_priv, 1); #endif } diff --git a/libmpcodecs/vf_vo.c b/libmpcodecs/vf_vo.c index 96cbee6b8c..fafdc1b7fb 100644 --- a/libmpcodecs/vf_vo.c +++ b/libmpcodecs/vf_vo.c @@ -148,10 +148,11 @@ static int control(struct vf_instance_s* vf, int request, void* data) mp_eosd_res_t res; memset(&res, 0, sizeof(res)); if (video_out->control(VOCTRL_GET_EOSD_RES, &res) == VO_TRUE) { + double dar = (double) (res.w - res.ml - res.mr) / (res.h - res.mt - res.mb); 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); #if defined(LIBASS_VERSION) && LIBASS_VERSION >= 0x00908000 - ass_set_aspect_ratio(vf->priv->ass_priv, (double)res.w / res.h, (double)res.srcw/res.srch); + ass_set_aspect_ratio(vf->priv->ass_priv, dar, (double)res.srcw/res.srch); #else ass_set_aspect_ratio(vf->priv->ass_priv, (double)res.w / res.h); #endif