diff options
author | wm4 <wm4@nowhere> | 2016-08-03 19:18:00 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2016-08-03 19:18:00 +0200 |
commit | 356e703510170151a1678e9b1deab2ffdd5c92fb (patch) | |
tree | 70976d224112903cc94ab14ea8c276ca956734e0 | |
parent | f3c35d8108e4eb7ee3f0a0291d4217914424213d (diff) | |
download | mpv-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.
-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; |