summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefano Pigozzi <stefano.pigozzi@gmail.com>2015-01-24 16:54:24 +0100
committerStefano Pigozzi <stefano.pigozzi@gmail.com>2015-01-24 16:54:24 +0100
commit13e35730b49a74ee80de7310378f88c256150cf4 (patch)
tree91c82eccb998b1de694033c591e3ecaf80aba7f9
parent3dc3bcf8b6c52c2f05ba1c95575c84484bb57b76 (diff)
downloadmpv-13e35730b49a74ee80de7310378f88c256150cf4.tar.bz2
mpv-13e35730b49a74ee80de7310378f88c256150cf4.tar.xz
cocoa: fix fallback for OpenGL 2.1 hardware [2]
Looks like it fails on context creation, not pixfmt creation.
-rw-r--r--video/out/gl_cocoa.c20
1 files changed, 13 insertions, 7 deletions
diff --git a/video/out/gl_cocoa.c b/video/out/gl_cocoa.c
index bae255f782..d8b0c29916 100644
--- a/video/out/gl_cocoa.c
+++ b/video/out/gl_cocoa.c
@@ -58,7 +58,9 @@ static void *cocoa_glgetaddr(const char *s)
return ret;
}
-static CGLError test_gl_version(CGLPixelFormatObj *pix,
+static CGLError test_gl_version(struct vo *vo,
+ CGLContextObj *ctx,
+ CGLPixelFormatObj *pix,
CGLOpenGLProfile version)
{
CGLPixelFormatAttribute attrs[] = {
@@ -84,6 +86,15 @@ static CGLError test_gl_version(CGLPixelFormatObj *pix,
err = CGLChoosePixelFormat(attrs, pix, &npix);
}
+ if (err != kCGLNoError) {
+ MP_ERR(vo, "error creating CGL pixel format: %s (%d)\n",
+ CGLErrorString(err), err);
+ goto error_out;
+ }
+
+ err = CGLCreateContext(*pix, 0, ctx);
+
+error_out:
return err;
}
@@ -98,17 +109,12 @@ static bool create_gl_context(struct MPGLContext *ctx)
};
for (int n = 0; n < MP_ARRAY_SIZE(gl_versions); n++) {
- err = test_gl_version(&p->pix, gl_versions[n]);
+ err = test_gl_version(ctx->vo, &p->ctx, &p->pix, gl_versions[n]);
if (err == kCGLNoError)
break;
}
if (err != kCGLNoError) {
- MP_FATAL(ctx->vo, "error creating CGL pixel format: %s (%d)\n",
- CGLErrorString(err), err);
- }
-
- if ((err = CGLCreateContext(p->pix, 0, &p->ctx)) != kCGLNoError) {
MP_FATAL(ctx->vo, "error creating CGL context: %s (%d)\n",
CGLErrorString(err), err);
return false;