From 3e092e15799d7c80e2af243380f4665fd97d4042 Mon Sep 17 00:00:00 2001 From: Matthew Waters Date: Tue, 24 Jun 2014 23:51:24 +1000 Subject: [PATCH] gl: XInitThreads when env variable is set This is too allow gst-launch debugging with multiple GL contexts as well as avoiding segfaulting innocent gtk+ apps that have not called XInitThreads. https://bugzilla.gnome.org/show_bug.cgi?id=731525 --- ext/gl/gstopengl.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/ext/gl/gstopengl.c b/ext/gl/gstopengl.c index bb692d7..471d5ac 100644 --- a/ext/gl/gstopengl.c +++ b/ext/gl/gstopengl.c @@ -77,6 +77,10 @@ #include #endif +#if GST_GL_HAVE_WINDOW_X11 +#include +#endif + #define GST_CAT_DEFAULT gst_gl_gstgl_debug GST_DEBUG_CATEGORY_STATIC (GST_CAT_DEFAULT); @@ -91,6 +95,11 @@ plugin_init (GstPlugin * plugin) bcm_host_init (); #endif +#if GST_GL_HAVE_WINDOW_X11 + if (g_getenv ("GST_GL_XINITTHREADS")) + XInitThreads (); +#endif + if (!gst_element_register (plugin, "glimagesink", GST_RANK_SECONDARY, GST_TYPE_GLIMAGE_SINK)) { return FALSE; -- 2.7.4