From 6407095871b8f177996a6ec3ee9a8c4f06bd63ee Mon Sep 17 00:00:00 2001 From: Dudemanguy Date: Fri, 22 Apr 2022 15:06:20 -0500 Subject: vo_gpu_next: avoid 0x0 resizes It is possible for vo_gpu_next to attempt a resize before the windowing backend is fully initialized. In practice, this can happen on wayland which means libplacebo attempts a 0x0 resize. Depending on the API, a 0x0 resize may be allowed (vulkan or d3d11), but libplacebo just returns a 0 in this case which mpv doesn't do anything with anyway. In the case of opengl, this usage is explictly forbidden and will result in a warning which may confuse users. Solve this by just not trying a resize if dwidth and dheight in the vo are not available. Fixes #10083. --- video/out/vo_gpu_next.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'video/out') diff --git a/video/out/vo_gpu_next.c b/video/out/vo_gpu_next.c index d859195200..628417218b 100644 --- a/video/out/vo_gpu_next.c +++ b/video/out/vo_gpu_next.c @@ -1021,8 +1021,10 @@ static void resize(struct vo *vo) struct mp_rect src, dst; struct mp_osd_res osd; vo_get_src_dst_rects(vo, &src, &dst, &osd); - gpu_ctx_resize(p->context, vo->dwidth, vo->dheight); - vo->want_redraw = true; + if (vo->dwidth && vo->dheight) { + gpu_ctx_resize(p->context, vo->dwidth, vo->dheight); + vo->want_redraw = true; + } if (mp_rect_equals(&p->src, &src) && mp_rect_equals(&p->dst, &dst) && -- cgit v1.2.3