summaryrefslogtreecommitdiffstats
path: root/video
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2016-08-03 19:18:00 +0200
committerwm4 <wm4@nowhere>2016-08-03 19:18:00 +0200
commit356e703510170151a1678e9b1deab2ffdd5c92fb (patch)
tree70976d224112903cc94ab14ea8c276ca956734e0 /video
parentf3c35d8108e4eb7ee3f0a0291d4217914424213d (diff)
downloadmpv-356e703510170151a1678e9b1deab2ffdd5c92fb.tar.bz2
mpv-356e703510170151a1678e9b1deab2ffdd5c92fb.tar.xz
vo_opengl_cb: log better error message if OpenGL not initialized by user
Otherwise opengl/video.c would confusingly complain about a wrong version, which in this case makes no sense.
Diffstat (limited to 'video')
-rw-r--r--video/out/vo_opengl_cb.c6
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;