From 2c0aca52a8c7f3c7f1bd21a40acb19f53e7026d9 Mon Sep 17 00:00:00 2001 From: Alessandro Decina Date: Wed, 10 Feb 2016 13:08:43 +1100 Subject: [PATCH] gstglcontext: micro optimization to gst_gl_context_thread_add Invoke the callback right away when called on the context thread. Removes overhead when nesting libgstgl calls (for example when working with the sync meta). --- gst-libs/gst/gl/gstglcontext.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/gst-libs/gst/gl/gstglcontext.c b/gst-libs/gst/gl/gstglcontext.c index f103146b8f..48a5387e8a 100644 --- a/gst-libs/gst/gl/gstglcontext.c +++ b/gst-libs/gst/gl/gstglcontext.c @@ -1489,8 +1489,10 @@ gst_gl_context_thread_add (GstGLContext * context, g_return_if_fail (GST_IS_GL_CONTEXT (context)); g_return_if_fail (func != NULL); - if (GST_IS_GL_WRAPPED_CONTEXT (context)) { + if (GST_IS_GL_WRAPPED_CONTEXT (context)) g_return_if_fail (context->priv->active_thread == g_thread_self ()); + + if (context->priv->active_thread == g_thread_self ()) { func (context, data); return; }