From 8884cfefa89f8fef90ab8df6f16707a3e02c55ee Mon Sep 17 00:00:00 2001 From: Jan Schmidt Date: Mon, 13 Jul 2009 12:53:17 +0100 Subject: [PATCH] [358/906] gstgldisplay: Close a small race starting the display thread Take the display lock before signalling the create-context cond to ensure the caller has dropped the lock and is therefore listening for the signal. --- gst-libs/gst/gl/gstgldisplay.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/gst-libs/gst/gl/gstgldisplay.c b/gst-libs/gst/gl/gstgldisplay.c index c0aae8721c..0f4dbcfa48 100644 --- a/gst-libs/gst/gl/gstgldisplay.c +++ b/gst-libs/gst/gl/gstgldisplay.c @@ -531,6 +531,7 @@ gst_gl_display_thread_create_context (GstGLDisplay * display) { GLenum err = 0; + gst_gl_display_lock (display); display->gl_window = gst_gl_window_new (display->upload_width, display->upload_height, display->external_gl_context); @@ -539,6 +540,7 @@ gst_gl_display_thread_create_context (GstGLDisplay * display) display->isAlive = FALSE; GST_ERROR_OBJECT (display, "Failed to create gl window"); g_cond_signal (display->cond_create_context); + gst_gl_display_unlock (display); return NULL; } @@ -602,6 +604,8 @@ gst_gl_display_thread_create_context (GstGLDisplay * display) g_cond_signal (display->cond_create_context); + gst_gl_display_unlock (display); + gst_gl_window_run_loop (display->gl_window); GST_INFO ("loop exited\n");