summaryrefslogtreecommitdiff
path: root/gst-libs
diff options
context:
space:
mode:
authorMatthew Waters <matthew@centricular.com>2016-03-08 00:35:22 +1100
committerMatthew Waters <matthew@centricular.com>2016-03-08 02:06:13 +1100
commitaa6062945c9e4e293332cfc6ab1832647c09008e (patch)
tree0062b6dad3aac5d50090be285d99d0fa38368372 /gst-libs
parent5f925a15805dd2384436c36ec1cc4248f8bb370b (diff)
downloadgstreamer-plugins-bad-aa6062945c9e4e293332cfc6ab1832647c09008e.tar.gz
gldisplay: make readding the same context a no-op
With e38af2304427db908a16bbae0e60aa68be1ba5b5 returning the correct contexts, gst_gl_display_add_context() was susceptible to causing infinte loops when adding the same GstGLContext more than once. Fix and add a test for gst_gl_display_add_context(). Fixes glvideomixer gst-validate tests.
Diffstat (limited to 'gst-libs')
-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;