[vlc-commits] opengl: interop: avoid generic interop with opaque
Alexandre Janniaux
git at videolan.org
Wed Nov 18 09:22:53 CET 2020
vlc | branch: master | Alexandre Janniaux <ajanni at videolabs.io> | Tue Nov 17 10:44:54 2020 +0100| [f367b9f517d11d3ef03b42fa587be6070bfc774a] | committer: Alexandre Janniaux
opengl: interop: avoid generic interop with opaque
The generic interop is designed for CPU buffers which are not available
anyway with GPU buffers (zero planes available). Avoid loading the
generic interop in that case.
Refs #25256
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=f367b9f517d11d3ef03b42fa587be6070bfc774a
---
modules/video_output/opengl/interop.c | 24 +++++++++++-------------
1 file changed, 11 insertions(+), 13 deletions(-)
diff --git a/modules/video_output/opengl/interop.c b/modules/video_output/opengl/interop.c
index 96d548519e..9abb2f802f 100644
--- a/modules/video_output/opengl/interop.c
+++ b/modules/video_output/opengl/interop.c
@@ -55,30 +55,28 @@ vlc_gl_interop_New(struct vlc_gl_t *gl, const struct vlc_gl_api *api,
vlc_object_delete(interop);
return NULL;
}
+
if (desc->plane_count == 0)
{
/* Opaque chroma: load a module to handle it */
interop->vctx = context;
interop->module = module_need_var(interop, "glinterop", "glinterop");
+ if (interop->module == NULL)
+ goto error;
}
-
- int ret;
- if (interop->module != NULL)
- ret = VLC_SUCCESS;
else
{
- /* Software chroma or gl hw converter failed: use a generic
- * converter */
- ret = opengl_interop_generic_init(interop, true);
- }
-
- if (ret != VLC_SUCCESS)
- {
- vlc_object_delete(interop);
- return NULL;
+ /* No opengl interop module found: use a generic interop. */
+ int ret = opengl_interop_generic_init(interop, true);
+ if (ret != VLC_SUCCESS)
+ goto error;
}
return interop;
+
+error:
+ vlc_object_delete(interop);
+ return NULL;
}
struct vlc_gl_interop *
More information about the vlc-commits
mailing list