Skip to content

Commit

Permalink
vo_gpu_next: fix assertion on wayland
Browse files Browse the repository at this point in the history
This code failed to handle the case of the swapchain submission being
skipped because the window was invisible.

Fixes: f9dc695
  • Loading branch information
haasn committed Jul 29, 2023
1 parent f9dc695 commit 3bf1d22
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions video/out/vo_gpu_next.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -1064,15 +1065,19 @@ static void draw_frame(struct vo *vo, struct vo_frame *frame)
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)
{
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);
}
Expand Down

0 comments on commit 3bf1d22

Please sign in to comment.