changeset 30488:595410bd114e

libass: fix PAR correction
author greg
date Tue, 09 Feb 2010 17:36:24 +0000
parents c529adc9c384
children 8ee6bb538f53
files libmpcodecs/vf_ass.c libmpcodecs/vf_vo.c
diffstat 2 files changed, 4 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/libmpcodecs/vf_ass.c	Tue Feb 09 08:46:07 2010 +0000
+++ b/libmpcodecs/vf_ass.c	Tue Feb 09 17:36:24 2010 +0000
@@ -95,9 +95,9 @@
 	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
 	}
 
--- a/libmpcodecs/vf_vo.c	Tue Feb 09 08:46:07 2010 +0000
+++ b/libmpcodecs/vf_vo.c	Tue Feb 09 17:36:24 2010 +0000
@@ -148,10 +148,11 @@
             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