From 390518a296c1de0637d66463d3b2e4ab26a2a092 Mon Sep 17 00:00:00 2001 From: Matthew Waters Date: Tue, 12 Jul 2022 14:47:20 +1000 Subject: [PATCH] glimagesink: only allow setting the GL display/context if it is a valid value Otherwise, when setting the external application context, then the display may be cleared and then not used and the asharing mechanism does not work anymore. Part-of: --- subprojects/gst-plugins-base/ext/gl/gstglimagesink.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/subprojects/gst-plugins-base/ext/gl/gstglimagesink.c b/subprojects/gst-plugins-base/ext/gl/gstglimagesink.c index f0d1fabd62..b6ee5de713 100644 --- a/subprojects/gst-plugins-base/ext/gl/gstglimagesink.c +++ b/subprojects/gst-plugins-base/ext/gl/gstglimagesink.c @@ -1241,8 +1241,10 @@ gst_glimage_sink_set_context (GstElement * element, GstContext * context) GstGLDisplay *display = NULL; gst_gl_handle_set_context (element, context, &display, &other_context); - _set_other_context (gl_sink, other_context); - _set_display (gl_sink, display); + if (display) + _set_display (gl_sink, display); + if (other_context) + _set_other_context (gl_sink, other_context); if (gl_sink->display) gst_gl_display_filter_gl_api (gl_sink->display, SUPPORTED_GL_APIS);