summaryrefslogtreecommitdiffstats
path: root/video/out/gl_common.c
diff options
context:
space:
mode:
Diffstat (limited to 'video/out/gl_common.c')
-rw-r--r--video/out/gl_common.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/video/out/gl_common.c b/video/out/gl_common.c
index 648d4462e8..48b1089147 100644
--- a/video/out/gl_common.c
+++ b/video/out/gl_common.c
@@ -893,18 +893,21 @@ int mpgl_validate_backend_opt(const struct m_option *opt, struct bstr name,
return mpgl_find_backend(s) >= -1 ? 1 : M_OPT_INVALID;
}
-static MPGLContext *init_backend(struct vo *vo, MPGLSetBackendFn set_backend)
+static MPGLContext *init_backend(struct vo *vo, MPGLSetBackendFn set_backend,
+ bool probing)
{
MPGLContext *ctx = talloc_ptrtype(NULL, ctx);
*ctx = (MPGLContext) {
.gl = talloc_zero(ctx, GL),
.vo = vo,
};
+ vo->probing = probing;
set_backend(ctx);
if (!ctx->vo_init(vo)) {
talloc_free(ctx);
ctx = NULL;
}
+ vo->probing = false;
return ctx;
}
@@ -914,12 +917,12 @@ MPGLContext *mpgl_init(struct vo *vo, const char *backend_name)
int index = mpgl_find_backend(backend_name);
if (index == -1) {
for (const struct backend *entry = backends; entry->name; entry++) {
- ctx = init_backend(vo, entry->init);
+ ctx = init_backend(vo, entry->init, true);
if (ctx)
- return ctx;
+ break;
}
} else if (index >= 0) {
- ctx = init_backend(vo, backends[index].init);
+ ctx = init_backend(vo, backends[index].init, false);
}
return ctx;
}