From 3bfdc20aa109ba191fd091daeaf9a0d380e71df9 Mon Sep 17 00:00:00 2001 From: wm4 Date: Sat, 11 Apr 2015 15:53:00 +0200 Subject: vo_opengl: fix blend-subtitles-res=video & anamorphic video Since scaling the video changes the aspect ratio, we have to compensate for this when rendering subtitles. --- video/out/gl_video.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/video/out/gl_video.c b/video/out/gl_video.c index c7ebcc13b8..a1f0bfbcc7 100644 --- a/video/out/gl_video.c +++ b/video/out/gl_video.c @@ -1837,7 +1837,12 @@ static void pass_render_frame(struct gl_video *p) vpts = p->osd_pts; if (p->osd && p->opts.blend_subs && p->opts.blend_subs_res == 1) { - struct mp_osd_res rect = { p->image_w, p->image_h, 0, 0, 0, 0, 1 }; + double scale[2]; + get_scale_factors(p, scale); + struct mp_osd_res rect = { + .w = p->image_w, .h = p->image_h, + .display_par = scale[1] / scale[0], // counter compensate scaling + }; finish_pass_fbo(p, &p->blend_subs_fbo, p->image_w, p->image_h, 0, 0); pass_draw_osd(p, OSD_DRAW_SUB_ONLY, vpts, rect, p->image_w, p->image_h, p->blend_subs_fbo.fbo, false); -- cgit v1.2.3