1
mirror of https://github.com/mpv-player/mpv synced 2024-11-03 03:19:24 +01:00

vo_gpu: error out if there were rendering errors when taking screenshot

This commit is contained in:
wm4 2018-03-02 12:15:03 +01:00 committed by Jan Ekström
parent 1b786a71c1
commit ecf4d7a843

View File

@ -3154,7 +3154,8 @@ done:
debug_check_gl(p, "after OSD rendering"); debug_check_gl(p, "after OSD rendering");
} }
if (gl_sc_error_state(p->sc) || p->broken_frame) { p->broken_frame |= gl_sc_error_state(p->sc);
if (p->broken_frame) {
// Make the screen solid blue to make it visually clear that an // Make the screen solid blue to make it visually clear that an
// error has occurred // error has occurred
float color[4] = {0.0, 0.05, 0.5, 1.0}; float color[4] = {0.0, 0.05, 0.5, 1.0};
@ -3237,6 +3238,9 @@ void gl_video_screenshot(struct gl_video *p, struct vo_frame *frame,
if (!p->ra->fns->tex_download(p->ra, &download_params)) if (!p->ra->fns->tex_download(p->ra, &download_params))
goto done; goto done;
if (p->broken_frame)
goto done;
ok = true; ok = true;
done: done:
ra_tex_free(p->ra, &target); ra_tex_free(p->ra, &target);