From d60f2dce1dcafaed0e21406213e66072f3036752 Mon Sep 17 00:00:00 2001 From: Oleg Oshmyan Date: Thu, 15 Oct 2020 04:13:10 +0300 Subject: Scale everything from script resolution if storage size is unknown MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit With this, our output can no longer change visually if display resolution is varied via ass_set_frame_size while everything else is kept constant, e. g. when a video player window is being resized, regardless of API (mis)use and script/track properties. In particular, this stops our \blur from affecting a varying portion of the screen and our 3D transforms involving \frx or \fry from moving around as display resolution is being changed. FWIW, this makes our blur and 3D transforms match MPC-HC's when storage size is unset. They already matched before this commit when ScaledBorderAndShadow was true, but now they also match when it is false. This also makes our borders and shadows scale with display resolution, effectively making ScaledBorderAndShadow a no-op (always true) if storage size is unset. FWIW, this does *not* agree with MPC-HC, but it just seems sensibleā„¢. --- libass/ass_render.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/libass/ass_render.c b/libass/ass_render.c index 6246274..eb3dbaf 100644 --- a/libass/ass_render.c +++ b/libass/ass_render.c @@ -983,14 +983,12 @@ static void init_font_scale(ASS_Renderer *render_priv) if (settings_priv->storage_height) render_priv->blur_scale = font_scr_h / settings_priv->storage_height; else - render_priv->blur_scale = 1.; + render_priv->blur_scale = font_scr_h / render_priv->track->PlayResY; if (render_priv->track->ScaledBorderAndShadow) render_priv->border_scale = font_scr_h / render_priv->track->PlayResY; else render_priv->border_scale = render_priv->blur_scale; - if (!settings_priv->storage_height) - render_priv->blur_scale = render_priv->border_scale; if (render_priv->state.apply_font_scale) { render_priv->font_scale *= settings_priv->font_size_coeff; -- cgit v1.2.3