summaryrefslogtreecommitdiff
path: root/gst-libs/gst/gl/gstgldisplay.c
diff options
context:
space:
mode:
Diffstat (limited to 'gst-libs/gst/gl/gstgldisplay.c')
-rw-r--r--gst-libs/gst/gl/gstgldisplay.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/gst-libs/gst/gl/gstgldisplay.c b/gst-libs/gst/gl/gstgldisplay.c
index 65ce1a301..5cae2f4b9 100644
--- a/gst-libs/gst/gl/gstgldisplay.c
+++ b/gst-libs/gst/gl/gstgldisplay.c
@@ -500,7 +500,7 @@ _check_collision (GstGLContext * context, GstGLContext * collision)
goto out;
}
- if (collision == context) {
+ if (thread == collision_thread) {
ret = TRUE;
goto out;
}
@@ -546,6 +546,13 @@ gst_gl_display_add_context (GstGLDisplay * display, GstGLContext * context)
if (thread) {
collision = _get_gl_context_for_thread_unlocked (display, thread);
g_thread_unref (thread);
+
+ /* adding the same context is a no-op */
+ if (context == collision) {
+ ret = TRUE;
+ goto out;
+ }
+
if (_check_collision (context, collision)) {
ret = FALSE;
goto out;