summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2016-12-09 21:31:45 +0100
committerwm4 <wm4@nowhere>2016-12-09 21:31:45 +0100
commit82855bec5036817f64ec90bae48135f5589ed1a5 (patch)
treed5a2dab23966cb7df9000a64c5ddf51ebe7978b5
parentc324bfab594cc9228f699d86c74e2b0da049bf58 (diff)
downloadmpv-82855bec5036817f64ec90bae48135f5589ed1a5.tar.bz2
mpv-82855bec5036817f64ec90bae48135f5589ed1a5.tar.xz
client API: allow passing NULL to mpv_opengl_cb_uninit_gl()
In which case it does nothing.
-rw-r--r--video/out/vo_opengl_cb.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/video/out/vo_opengl_cb.c b/video/out/vo_opengl_cb.c
index 85e06ff598..852b7900da 100644
--- a/video/out/vo_opengl_cb.c
+++ b/video/out/vo_opengl_cb.c
@@ -204,6 +204,9 @@ int mpv_opengl_cb_init_gl(struct mpv_opengl_cb_context *ctx, const char *exts,
int mpv_opengl_cb_uninit_gl(struct mpv_opengl_cb_context *ctx)
{
+ if (!ctx)
+ return 0;
+
// Bring down the decoder etc., which still might be using the hwdec
// context. Setting initialized=false guarantees it can't come back.