diff options
author | Grigori Goronzy <greg@blackbox> | 2009-07-25 03:38:56 +0200 |
---|---|---|
committer | Grigori Goronzy <greg@blackbox> | 2009-07-25 14:56:00 +0200 |
commit | a9f204bdde79bdacb63672482f5666b1e64f4479 (patch) | |
tree | ea0839e8bdec298147924ed871f375b6c372220f | |
parent | d7635a84ed7c852e2045ba5a298ea12c477033b3 (diff) | |
download | libass-a9f204bdde79bdacb63672482f5666b1e64f4479.tar.bz2 libass-a9f204bdde79bdacb63672482f5666b1e64f4479.tar.xz |
Assume 4:3 AR when calculating missing PlayResX/Y
In case only one PlayResX/Y component is specified, calculate the other
component by assuming a 4:3 aspect ratio. This is similar to vsfilter.
-rw-r--r-- | libass/ass_render.c | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/libass/ass_render.c b/libass/ass_render.c index d2f3c1bc..94556f97 100644 --- a/libass/ass_render.c +++ b/libass/ass_render.c @@ -252,7 +252,6 @@ struct render_priv_s { static void ass_lazy_track_init(ass_renderer_t *render_priv) { ass_track_t *track = render_priv->track; - ass_settings_t *settings_priv = &render_priv->settings; if (track->PlayResX && track->PlayResY) return; @@ -262,16 +261,12 @@ static void ass_lazy_track_init(ass_renderer_t *render_priv) track->PlayResX = 384; track->PlayResY = 288; } else { - double orig_aspect = - (settings_priv->aspect * render_priv->height * - render_priv->orig_width) / render_priv->orig_height / - render_priv->width; if (!track->PlayResY && track->PlayResX == 1280) { track->PlayResY = 1024; ass_msg(render_priv->library, MSGL_WARN, "PlayResY undefined, setting to %d", track->PlayResY); } else if (!track->PlayResY) { - track->PlayResY = track->PlayResX / orig_aspect + .5; + track->PlayResY = track->PlayResX * 3 / 4; ass_msg(render_priv->library, MSGL_WARN, "PlayResY undefined, setting to %d", track->PlayResY); } else if (!track->PlayResX && track->PlayResY == 1024) { @@ -279,7 +274,7 @@ static void ass_lazy_track_init(ass_renderer_t *render_priv) ass_msg(render_priv->library, MSGL_WARN, "PlayResX undefined, setting to %d", track->PlayResX); } else if (!track->PlayResX) { - track->PlayResX = track->PlayResY * orig_aspect + .5; + track->PlayResX = track->PlayResY * 4 / 3; ass_msg(render_priv->library, MSGL_WARN, "PlayResX undefined, setting to %d", track->PlayResX); } |