summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Nauwelaerts <mnauw@users.sourceforge.net>2016-03-05 17:16:24 +0100
committerMark Nauwelaerts <mnauw@users.sourceforge.net>2016-03-06 12:10:51 +0100
commite38af2304427db908a16bbae0e60aa68be1ba5b5 (patch)
tree695503e67a3f325ff770af16037202b2b223d91b
parent23806d4953d9014067105ae2a05dd3ff14fa41b7 (diff)
downloadgstreamer-plugins-bad-e38af2304427db908a16bbae0e60aa68be1ba5b5.tar.gz
gldisplay: really retrieve glcontext for a specific thread
When requesting a glcontext (regardless of thread), the result was correct. However, when requesting current glcontext on a specific thread, it could come up with a glcontext active on another thread. https://bugzilla.gnome.org/show_bug.cgi?id=763168
-rw-r--r--gst-libs/gst/gl/gstgldisplay.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/gst-libs/gst/gl/gstgldisplay.c b/gst-libs/gst/gl/gstgldisplay.c
index 60dec6aa3..65ce1a301 100644
--- a/gst-libs/gst/gl/gstgldisplay.c
+++ b/gst-libs/gst/gl/gstgldisplay.c
@@ -437,8 +437,11 @@ _get_gl_context_for_thread_unlocked (GstGLDisplay * display, GThread * thread)
continue;
}
+ if (thread == NULL)
+ return context;
+
context_thread = gst_gl_context_get_thread (context);
- if (thread != NULL && thread == context_thread) {
+ if (thread != context_thread) {
g_thread_unref (context_thread);
gst_object_unref (context);
prev = l;