diff options
author | Niklas Haas <git@haasn.dev> | 2023-07-29 19:09:45 +0200 |
---|---|---|
committer | Niklas Haas <git@haasn.dev> | 2023-07-29 19:09:45 +0200 |
commit | 3bf1d22879c90fbde99bce1d3a6a54e86d298a5e (patch) | |
tree | 5b1f73fd1a896ad9efe844eb5c2d0fa99b5baedf /video | |
parent | f9dc695b580c394bf4f9833d36e91b7fcbe009ea (diff) | |
download | mpv-3bf1d22879c90fbde99bce1d3a6a54e86d298a5e.tar.bz2 mpv-3bf1d22879c90fbde99bce1d3a6a54e86d298a5e.tar.xz |
vo_gpu_next: fix assertion on wayland
This code failed to handle the case of the swapchain submission being
skipped because the window was invisible.
Fixes: f9dc695b580c394bf4f9833d36e91b7fcbe009ea
Diffstat (limited to 'video')
-rw-r--r-- | video/out/vo_gpu_next.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/video/out/vo_gpu_next.c b/video/out/vo_gpu_next.c index ddc22bcbde..30034f98b9 100644 --- a/video/out/vo_gpu_next.c +++ b/video/out/vo_gpu_next.c @@ -116,6 +116,7 @@ struct priv { double last_pts; bool is_interpolated; bool want_reset; + bool frame_pending; struct m_config_cache *opts_cache; struct mp_csp_equalizer_state *video_eq; @@ -1064,6 +1065,7 @@ done: pl_tex_clear(gpu, swframe.fbo, (float[4]){ 0.5, 0.0, 1.0, 1.0 }); pl_gpu_flush(gpu); + p->frame_pending = true; } static void flip_page(struct vo *vo) @@ -1071,8 +1073,11 @@ static void flip_page(struct vo *vo) struct priv *p = vo->priv; struct ra_swapchain *sw = p->ra_ctx->swapchain; - if (!pl_swapchain_submit_frame(p->sw)) - MP_ERR(vo, "Failed presenting frame!\n"); + if (p->frame_pending) { + if (!pl_swapchain_submit_frame(p->sw)) + MP_ERR(vo, "Failed presenting frame!\n"); + p->frame_pending = false; + } sw->fns->swap_buffers(sw); } |