diff options
Diffstat (limited to 'video/out/vo_opengl_cb.c')
-rw-r--r-- | video/out/vo_opengl_cb.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/video/out/vo_opengl_cb.c b/video/out/vo_opengl_cb.c index 4ac0c96b1e..06c90d2e5b 100644 --- a/video/out/vo_opengl_cb.c +++ b/video/out/vo_opengl_cb.c @@ -175,10 +175,16 @@ int mpv_opengl_cb_init_gl(struct mpv_opengl_cb_context *ctx, const char *exts, if (ctx->renderer) return MPV_ERROR_INVALID_PARAMETER; + talloc_free(ctx->gl); ctx->gl = talloc_zero(ctx, GL); mpgl_load_functions2(ctx->gl, get_proc_address, get_proc_address_ctx, exts, ctx->log); + if (!ctx->gl->version && !ctx->gl->es) { + MP_FATAL(ctx, "OpenGL not initialized.\n"); + return MPV_ERROR_UNSUPPORTED; + } + ctx->renderer = gl_video_init(ctx->gl, ctx->log, ctx->global); if (!ctx->renderer) return MPV_ERROR_UNSUPPORTED; |