summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Forney <mforney@mforney.org>2020-05-16 15:25:58 -0700
committerwm4 <1387750+wm4@users.noreply.github.com>2020-05-17 12:53:26 +0200
commit3cb9e93cdf8a71154a70d0cfa1e0676905d5a436 (patch)
tree4b1afd2eba4c6ac59f43c760a95beeca1c9ce582
parent43cb89fca3bdddf4ab3c09618aab38a1d94f8c5c (diff)
downloadmpv-3cb9e93cdf8a71154a70d0cfa1e0676905d5a436.tar.bz2
mpv-3cb9e93cdf8a71154a70d0cfa1e0676905d5a436.tar.xz
vo_wlshm, vo_drm: set image size with mp_image_set_size
The image w and h members must match params.w and params.h, so should not be changed directly. The helper function mp_image_set_size is designed for this purpose, so just use that instead. This prevents an assertion error with the rewritten draw_bmp. Fixes #7721.
-rw-r--r--video/out/vo_drm.c3
-rw-r--r--video/out/vo_wlshm.c3
2 files changed, 2 insertions, 4 deletions
diff --git a/video/out/vo_drm.c b/video/out/vo_drm.c
index 0a5c714744..a2c6fc8652 100644
--- a/video/out/vo_drm.c
+++ b/video/out/vo_drm.c
@@ -322,8 +322,7 @@ static int reconfig(struct vo *vo, struct mp_image_params *params)
p->cur_frame = mp_image_alloc(p->imgfmt, p->screen_w, p->screen_h);
mp_image_params_guess_csp(&p->sws->dst);
mp_image_set_params(p->cur_frame, &p->sws->dst);
- p->cur_frame[0].w = p->screen_w;
- p->cur_frame[0].h = p->screen_h;
+ mp_image_set_size(p->cur_frame, p->screen_w, p->screen_h);
talloc_free(p->cur_frame_cropped);
p->cur_frame_cropped = mp_image_new_dummy_ref(p->cur_frame);
diff --git a/video/out/vo_wlshm.c b/video/out/vo_wlshm.c
index 40c5b0da0f..3583ce3e73 100644
--- a/video/out/vo_wlshm.c
+++ b/video/out/vo_wlshm.c
@@ -112,8 +112,7 @@ static struct buffer *buffer_create(struct vo *vo, int width, int height)
buf->vo = vo;
buf->size = size;
mp_image_set_params(&buf->mpi, &p->sws->dst);
- buf->mpi.w = width;
- buf->mpi.h = height;
+ mp_image_set_size(&buf->mpi, width, height);
buf->mpi.planes[0] = data;
buf->mpi.stride[0] = stride;
buf->pool = wl_shm_create_pool(wl->shm, fd, size);