mirror of https://github.com/mpv-player/mpv
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: f9dc695b58
This commit is contained in:
parent
f9dc695b58
commit
3bf1d22879
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue