From 82855bec5036817f64ec90bae48135f5589ed1a5 Mon Sep 17 00:00:00 2001 From: wm4 Date: Fri, 9 Dec 2016 21:31:45 +0100 Subject: client API: allow passing NULL to mpv_opengl_cb_uninit_gl() In which case it does nothing. --- video/out/vo_opengl_cb.c | 3 +++ 1 file changed, 3 insertions(+) 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. -- cgit v1.2.3