vo_dmabuf_wayland: fix scaling for subsurface positioning

It's off if the video aspect ratio doesn't match the monitor aspect
ratio. Fixes c243946338.
This commit is contained in:
Dudemanguy 2024-04-21 12:55:04 -05:00
parent 5318522b50
commit 8db1902ae9
1 changed files with 2 additions and 2 deletions

View File

@ -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);
}