diff --git a/video/out/vo_dmabuf_wayland.c b/video/out/vo_dmabuf_wayland.c index 0ff30b6495..3c45757387 100644 --- a/video/out/vo_dmabuf_wayland.c +++ b/video/out/vo_dmabuf_wayland.c @@ -451,7 +451,7 @@ static void create_shm_pool(struct vo *vo) struct vo_wayland_state *wl = vo->wl; struct priv *p = vo->priv; - int stride = MP_ALIGN_UP(vo->dwidth * 4, 16); + int stride = MP_ALIGN_UP(vo->dwidth * 4, MP_IMAGE_BYTE_ALIGN); size_t size = vo->dheight * stride; int fd = vo_wayland_allocate_memfd(vo, size); if (fd < 0) @@ -783,7 +783,7 @@ static int preinit(struct vo *vo) } else { int width = 1; int height = 1; - int stride = MP_ALIGN_UP(width * 4, 16); + int stride = MP_ALIGN_UP(width * 4, MP_IMAGE_BYTE_ALIGN); int fd = vo_wayland_allocate_memfd(vo, stride); if (fd < 0) goto err; diff --git a/video/out/vo_wlshm.c b/video/out/vo_wlshm.c index 3a13b82d0f..3132d7a563 100644 --- a/video/out/vo_wlshm.c +++ b/video/out/vo_wlshm.c @@ -85,7 +85,7 @@ static struct buffer *buffer_create(struct vo *vo, int width, int height) uint8_t *data; struct buffer *buf; - stride = MP_ALIGN_UP(width * 4, 16); + stride = MP_ALIGN_UP(width * 4, MP_IMAGE_BYTE_ALIGN); size = height * stride; fd = vo_wayland_allocate_memfd(vo, size); if (fd < 0) @@ -264,12 +264,12 @@ static void draw_frame(struct vo *vo, struct vo_frame *frame) struct mp_image dst = buf->mpi; struct mp_rect src_rc; struct mp_rect dst_rc; - src_rc.x0 = MP_ALIGN_DOWN(p->src.x0, MPMAX(src->fmt.align_x, 4)); - src_rc.y0 = MP_ALIGN_DOWN(p->src.y0, MPMAX(src->fmt.align_y, 4)); + src_rc.x0 = MP_ALIGN_DOWN(p->src.x0, src->fmt.align_x); + src_rc.y0 = MP_ALIGN_DOWN(p->src.y0, src->fmt.align_y); src_rc.x1 = p->src.x1 - (p->src.x0 - src_rc.x0); src_rc.y1 = p->src.y1 - (p->src.y0 - src_rc.y0); - dst_rc.x0 = MP_ALIGN_DOWN(p->dst.x0, MPMAX(dst.fmt.align_x, 4)); - dst_rc.y0 = MP_ALIGN_DOWN(p->dst.y0, MPMAX(dst.fmt.align_y, 4)); + dst_rc.x0 = MP_ALIGN_DOWN(p->dst.x0, dst.fmt.align_x); + dst_rc.y0 = MP_ALIGN_DOWN(p->dst.y0, dst.fmt.align_y); dst_rc.x1 = p->dst.x1 - (p->dst.x0 - dst_rc.x0); dst_rc.y1 = p->dst.y1 - (p->dst.y0 - dst_rc.y0); mp_image_crop_rc(src, src_rc);