client API: allow passing NULL to mpv_opengl_cb_uninit_gl()

In which case it does nothing.
This commit is contained in:
wm4 2016-12-09 21:31:45 +01:00
parent c324bfab59
commit 82855bec50
1 changed files with 3 additions and 0 deletions

View File

@ -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.