summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2015-11-16 16:15:07 +0100
committerwm4 <wm4@nowhere>2015-11-16 16:15:07 +0100
commit07c546b2b494a620edc98dadd5dd78a052ec6783 (patch)
treed337687d13953c3b94943b11be87f37054ad3253
parentbf0b178e71d76c839d6d17c42a83536e444ba31d (diff)
downloadmpv-07c546b2b494a620edc98dadd5dd78a052ec6783.tar.bz2
mpv-07c546b2b494a620edc98dadd5dd78a052ec6783.tar.xz
vo_opengl: fix backend autoprobing
We want the following behavior: - VO probed, backend probed: only accept non-sw, fail completely otherwise - VO forced, backend probed: use the first non-sw, or if none is found, fall back to the first working sw backend - VO probed, backend forced: (I don't care about this case) - VO forced, backend forced: just use that backend Also, on backend probe failure the vo->probed field was left in its old state.
-rw-r--r--video/out/opengl/common.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/video/out/opengl/common.c b/video/out/opengl/common.c
index e0e3d498ca..3ac01268d5 100644
--- a/video/out/opengl/common.c
+++ b/video/out/opengl/common.c
@@ -597,6 +597,7 @@ static MPGLContext *init_backend(struct vo *vo, const struct mpgl_driver *driver
MP_VERBOSE(vo, "Initializing OpenGL backend '%s'\n", ctx->driver->name);
ctx->priv = talloc_zero_size(ctx, ctx->driver->priv_size);
if (ctx->driver->init(ctx, vo_flags) < 0) {
+ vo->probing = old_probing;
talloc_free(ctx);
return NULL;
}
@@ -639,6 +640,14 @@ MPGLContext *mpgl_init(struct vo *vo, const char *backend_name, int vo_flags)
if (ctx)
break;
}
+ // VO forced, but no backend is ok => force the first that works at all
+ if (!ctx && !vo->probing) {
+ for (int n = 0; n < MP_ARRAY_SIZE(backends); n++) {
+ ctx = init_backend(vo, backends[n], false, vo_flags);
+ if (ctx)
+ break;
+ }
+ }
} else if (index >= 0) {
ctx = init_backend(vo, backends[index], false, vo_flags);
}