summaryrefslogtreecommitdiffstats
path: root/video
diff options
context:
space:
mode:
authorDudemanguy <random342@airmail.cc>2024-04-21 13:31:50 -0500
committerDudemanguy <random342@airmail.cc>2024-04-21 13:42:49 -0500
commitd255f31f982c9b424c399ea5ed4061b5907ce389 (patch)
treed5b4e26294bff3ae7d44249de288fb657e569956 /video
parent8db1902ae93362214c8e475d43981c87503920dd (diff)
downloadmpv-d255f31f982c9b424c399ea5ed4061b5907ce389.tar.bz2
mpv-d255f31f982c9b424c399ea5ed4061b5907ce389.tar.xz
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.
Diffstat (limited to 'video')
-rw-r--r--video/out/vo_dmabuf_wayland.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/video/out/vo_dmabuf_wayland.c b/video/out/vo_dmabuf_wayland.c
index 2e3154fc27..be8b0f1272 100644
--- a/video/out/vo_dmabuf_wayland.c
+++ b/video/out/vo_dmabuf_wayland.c
@@ -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;
}
}