diff options
author | Dudemanguy <random342@airmail.cc> | 2022-04-22 15:06:20 -0500 |
---|---|---|
committer | Dudemanguy <random342@airmail.cc> | 2022-04-24 22:35:54 +0000 |
commit | 6407095871b8f177996a6ec3ee9a8c4f06bd63ee (patch) | |
tree | 4a6fde7aba5d0890fa55874d247536d75d0c0abc /video/out | |
parent | 9d133eb00b541eecf828a03a7da1c9ec502287ba (diff) | |
download | mpv-6407095871b8f177996a6ec3ee9a8c4f06bd63ee.tar.bz2 mpv-6407095871b8f177996a6ec3ee9a8c4f06bd63ee.tar.xz |
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.
Diffstat (limited to 'video/out')
-rw-r--r-- | video/out/vo_gpu_next.c | 6 |
1 files changed, 4 insertions, 2 deletions
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) && |