vo_dmabuf_wayland: use wl_fixed_from_int when setting viewport source

When this was originally implemented, the fixed conversion factor was
accidentally reverse engineered. It was left as is though. Instead, use
the wl_fixed_from_int helper, so it's more obvious what is going on
here.
This commit is contained in:
Dudemanguy 2024-04-21 13:31:50 -05:00
parent 8db1902ae9
commit d255f31f98
1 changed files with 3 additions and 3 deletions

View File

@ -494,9 +494,9 @@ static void set_viewport_source(struct vo *vo, struct mp_rect src)
return;
if (!mp_rect_equals(&p->src, &src)) {
wp_viewport_set_source(wl->video_viewport, src.x0 << 8,
src.y0 << 8, mp_rect_w(src) << 8,
mp_rect_h(src) << 8);
wp_viewport_set_source(wl->video_viewport, wl_fixed_from_int(src.x0),
wl_fixed_from_int(src.y0), wl_fixed_from_int(mp_rect_w(src)),
wl_fixed_from_int(mp_rect_h(src)));
p->src = src;
}
}