mirror of https://github.com/mpv-player/mpv
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:
parent
8db1902ae9
commit
d255f31f98
|
@ -494,9 +494,9 @@ static void set_viewport_source(struct vo *vo, struct mp_rect src)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (!mp_rect_equals(&p->src, &src)) {
|
if (!mp_rect_equals(&p->src, &src)) {
|
||||||
wp_viewport_set_source(wl->video_viewport, src.x0 << 8,
|
wp_viewport_set_source(wl->video_viewport, wl_fixed_from_int(src.x0),
|
||||||
src.y0 << 8, mp_rect_w(src) << 8,
|
wl_fixed_from_int(src.y0), wl_fixed_from_int(mp_rect_w(src)),
|
||||||
mp_rect_h(src) << 8);
|
wl_fixed_from_int(mp_rect_h(src)));
|
||||||
p->src = src;
|
p->src = src;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue