From bb07b22d4248492c859d2e4c0d2ff2941db1db86 Mon Sep 17 00:00:00 2001 From: Anton Kindestam Date: Sun, 18 Feb 2018 23:51:10 +0100 Subject: egl_helpers: mpegl_cb can now signal an error condition This can be used by client code that needs to fail when it cannot find a suitable EGLConfig. --- video/out/opengl/egl_helpers.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'video/out/opengl/egl_helpers.c') diff --git a/video/out/opengl/egl_helpers.c b/video/out/opengl/egl_helpers.c index 55bf376973..2de02b3eb4 100644 --- a/video/out/opengl/egl_helpers.c +++ b/video/out/opengl/egl_helpers.c @@ -108,6 +108,11 @@ static bool create_context(struct ra_ctx *ctx, EGLDisplay display, int chosen = 0; if (cb.refine_config) chosen = cb.refine_config(cb.user_data, configs, num_configs); + if (chosen < 0) { + talloc_free(configs); + MP_MSG(ctx, msgl, "Could not choose EGLConfig!\n"); + return false; + } EGLConfig config = configs[chosen]; talloc_free(configs); -- cgit v1.2.3