Skip to content
Snippets Groups Projects
Commit 0095945c authored by Romain Vimont's avatar Romain Vimont Committed by Steve Lhomme
Browse files

opengl: interop: hold video context

The video context must not be destroyed while the interop is alive.
parent b3ffbdb6
No related branches found
No related tags found
No related merge requests found
......@@ -180,11 +180,13 @@ vlc_gl_interop_New(struct vlc_gl_t *gl, vlc_video_context *context,
if (desc->plane_count == 0)
{
/* Opaque chroma: load a module to handle it */
interop->vctx = context;
assert(context);
interop->vctx = vlc_video_context_Hold(context);
interop->module = module_need_var(interop, "glinterop", "glinterop");
}
else
{
interop->vctx = NULL;
interop->module = module_need(interop, "opengl sw interop", NULL, false);
}
......@@ -233,6 +235,8 @@ vlc_gl_interop_Delete(struct vlc_gl_interop *interop)
{
if (interop->ops && interop->ops->close)
interop->ops->close(interop);
if (interop->vctx)
vlc_video_context_Release(interop->vctx);
if (interop->module)
module_unneed(interop, interop->module);
vlc_object_delete(interop);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment