From 98f74335d509320f19db2da8786273f95cad2a69 Mon Sep 17 00:00:00 2001 From: wm4 Date: Thu, 18 Oct 2012 17:31:00 +0200 Subject: sub: fix text subtitle aspect ratio with vo_xv and vo_lavc, refactor This fixes that vo_xv didn't display text subtitles correctly when using anamorphic video. It didn't pass the aspect information to the subtitle renderer. Also, try to render OSD correctly with respect to aspect ratio settings: on vo_xv, the OSD is rendered into the video, and needs to be "stretched" too when playing anamorphic video. When the -monitorpixelaspect option is used, even with VOs such as vo_opengl the OSD has to be rendered with that aspect ratio. As preparation for future commits, replace the weird vsfilter_scale value with a somewhat more sensible video_par member. Also, struct mp_eosd_res is a better place for the aspect ratio parameters, as OSD needs this too. Use osd_draw_on_image() directly in vo_lavc, which fixes aspect ratio issues as well. --- sub/sd_ass.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sub/sd_ass.c') diff --git a/sub/sd_ass.c b/sub/sd_ass.c index a5e23d74da..7926820ece 100644 --- a/sub/sd_ass.c +++ b/sub/sd_ass.c @@ -137,11 +137,11 @@ static void get_bitmaps(struct sh_sub *sh, struct osd_state *osd, if (params->pts == MP_NOPTS_VALUE) return; - double scale = params->normal_scale; + double scale = params->dim.display_par; bool use_vs_aspect = opts->ass_style_override ? opts->ass_vsfilter_aspect_compat : 1; if (ctx->vsfilter_aspect && use_vs_aspect) - scale = params->vsfilter_scale; + scale = scale * params->dim.video_par; ASS_Renderer *renderer = osd->ass_renderer; mp_ass_configure(renderer, opts, ¶ms->dim); ass_set_aspect_ratio(renderer, scale, 1); -- cgit v1.2.3