summaryrefslogtreecommitdiffstats
path: root/sub/sd_ass.c
diff options
context:
space:
mode:
authorRudolf Polzer <divVerent@xonotic.org>2013-11-01 13:15:59 +0100
committerRudolf Polzer <divverent@xonotic.org>2013-11-07 12:56:07 +0100
commit49caa0a775be06539a7cd30875f1c80368a7ac55 (patch)
tree5afa4280cf85e2dfad9339fc852d65912104c58a /sub/sd_ass.c
parentdbb7927a1e8ceeff959500591e9e57d08d85baeb (diff)
downloadmpv-49caa0a775be06539a7cd30875f1c80368a7ac55.tar.bz2
mpv-49caa0a775be06539a7cd30875f1c80368a7ac55.tar.xz
sd_ass, sd_lavc: use the input video's pixel aspect for scaling subtitles.
The previous code used the output video's pixel aspect for stretching purposes, breaking rendering with e.g. -vf scale in the chain. Now subtitles are stretched using the input video's pixel aspect only, matching the intentions of the original subtitle author.
Diffstat (limited to 'sub/sd_ass.c')
-rw-r--r--sub/sd_ass.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/sub/sd_ass.c b/sub/sd_ass.c
index 591f9d5105..fd545cdbda 100644
--- a/sub/sd_ass.c
+++ b/sub/sd_ass.c
@@ -142,7 +142,10 @@ static void get_bitmaps(struct sd *sd, struct mp_osd_res dim, double pts,
if (!ctx->is_converted && (!opts->ass_style_override ||
opts->ass_vsfilter_aspect_compat))
{
- scale = scale * dim.video_par;
+ // Let's use the original video PAR for vsfilter compatibility:
+ scale = scale
+ * (ctx->video_params.d_w / (double)ctx->video_params.d_h)
+ / (ctx->video_params.w / (double)ctx->video_params.h);
}
mp_ass_configure(renderer, opts, &dim);
ass_set_aspect_ratio(renderer, scale, 1);