Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/videolan/dav1d.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNiklas Haas <git@haasn.xyz>2020-05-20 08:01:47 +0300
committerNiklas Haas <git@haasn.xyz>2020-05-20 08:08:04 +0300
commitdf40d36d84fbdd3aae827b36d1a15739efb9225b (patch)
tree93f2afe6f0d3d2a3a981bbd9c99427cf33f82455
parentdd1ed29bd0e8069b2cd18b059e44d4288c218989 (diff)
dav1dplay: don't freeze on render errors0.7.0
Returning out of this function when pl_render_image() fails is the wrong thing to do, since that leaves the swapchain frame acquired but never submitted. Instead, just clear the target FBO to blank red (to make it clear that something went wrong) and continue on with presentation.
-rw-r--r--examples/dp_renderer_placebo.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/examples/dp_renderer_placebo.c b/examples/dp_renderer_placebo.c
index 00afcdb..7e7771c 100644
--- a/examples/dp_renderer_placebo.c
+++ b/examples/dp_renderer_placebo.c
@@ -328,8 +328,7 @@ static void placebo_render(void *cookie, const Dav1dPlaySettings *settings)
if (!pl_render_image(rd_priv_ctx->renderer, &rd_priv_ctx->image, &target, &render_params)) {
fprintf(stderr, "Failed rendering frame!\n");
- SDL_UnlockMutex(rd_priv_ctx->lock);
- return;
+ pl_tex_clear(rd_priv_ctx->gpu, target.fbo, (float[4]){ 1.0 });
}
ok = pl_swapchain_submit_frame(rd_priv_ctx->swapchain);