summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2015-04-11 15:53:00 +0200
committerwm4 <wm4@nowhere>2015-04-11 15:53:00 +0200
commit3bfdc20aa109ba191fd091daeaf9a0d380e71df9 (patch)
tree5bbd3262d558598ab6d5654715e6c914f97ff244
parentea11b09bc3a3558dfb3210f702b83b60cc27d716 (diff)
downloadmpv-3bfdc20aa109ba191fd091daeaf9a0d380e71df9.tar.bz2
mpv-3bfdc20aa109ba191fd091daeaf9a0d380e71df9.tar.xz
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.
-rw-r--r--video/out/gl_video.c7
1 files changed, 6 insertions, 1 deletions
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);