summaryrefslogtreecommitdiffstats
path: root/video
diff options
context:
space:
mode:
authorDudemanguy <random342@airmail.cc>2024-04-21 12:55:04 -0500
committerDudemanguy <random342@airmail.cc>2024-04-21 13:42:49 -0500
commit8db1902ae93362214c8e475d43981c87503920dd (patch)
tree84b41ccb4f6e93c1079b41e25350d6f8e16b422f /video
parent5318522b500d89593afc79840445ed723b30f50d (diff)
downloadmpv-8db1902ae93362214c8e475d43981c87503920dd.tar.bz2
mpv-8db1902ae93362214c8e475d43981c87503920dd.tar.xz
vo_dmabuf_wayland: fix scaling for subsurface positioning
It's off if the video aspect ratio doesn't match the monitor aspect ratio. Fixes c243946338dcdcdbed9cfdc9d662d5612649932d.
Diffstat (limited to 'video')
-rw-r--r--video/out/vo_dmabuf_wayland.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/video/out/vo_dmabuf_wayland.c b/video/out/vo_dmabuf_wayland.c
index 35a4dac464..2e3154fc27 100644
--- a/video/out/vo_dmabuf_wayland.c
+++ b/video/out/vo_dmabuf_wayland.c
@@ -537,10 +537,10 @@ static void resize(struct vo *vo)
vo_get_src_dst_rects(vo, &src, &dst, &p->screen_osd_res);
wp_viewport_set_destination(wl->video_viewport, lround(mp_rect_w(dst) / wl->scaling),
lround(mp_rect_h(dst) / wl->scaling));
- wl_subsurface_set_position(wl->video_subsurface, dst.x0, dst.y0);
+ wl_subsurface_set_position(wl->video_subsurface, lround(dst.x0 / wl->scaling), lround(dst.y0 / wl->scaling));
wp_viewport_set_destination(wl->osd_viewport, lround(vo->dwidth / wl->scaling),
lround(vo->dheight / wl->scaling));
- wl_subsurface_set_position(wl->osd_subsurface, 0 - dst.x0, 0 - dst.y0);
+ wl_subsurface_set_position(wl->osd_subsurface, lround((0 - dst.x0) / wl->scaling), lround((0 - dst.y0) / wl->scaling));
set_viewport_source(vo, src);
}