diff --git a/video/out/vo_opengl_cb.c b/video/out/vo_opengl_cb.c index 6c425e390d..7accfc1a92 100644 --- a/video/out/vo_opengl_cb.c +++ b/video/out/vo_opengl_cb.c @@ -129,8 +129,6 @@ struct mpv_opengl_cb_context *mp_opengl_create(struct mpv_global *g, pthread_mutex_init(&ctx->lock, NULL); pthread_cond_init(&ctx->wakeup, NULL); - ctx->gl = talloc_zero(ctx, GL); - ctx->global = g; ctx->log = mp_log_new(ctx, g->log, "opengl-cb"); ctx->client_api = client_api; @@ -174,6 +172,8 @@ int mpv_opengl_cb_init_gl(struct mpv_opengl_cb_context *ctx, const char *exts, if (ctx->renderer) return MPV_ERROR_INVALID_PARAMETER; + ctx->gl = talloc_zero(ctx, GL); + mpgl_load_functions2(ctx->gl, get_proc_address, get_proc_address_ctx, exts, ctx->log); ctx->renderer = gl_video_init(ctx->gl, ctx->log, ctx->global);