shithub: dav1d

Download patch

ref: df40d36d84fbdd3aae827b36d1a15739efb9225b
parent: dd1ed29bd0e8069b2cd18b059e44d4288c218989
author: Niklas Haas <git@haasn.xyz>
date: Wed May 20 03:01:47 EDT 2020

dav1dplay: don't freeze on render errors

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.

--- a/examples/dp_renderer_placebo.c
+++ b/examples/dp_renderer_placebo.c
@@ -328,8 +328,7 @@
 
     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);