gldisplay: synchronize the searching and creation of GstGLContext's

Ootherwise we could end up with multiple elements in different chains
each creating a context.  Fixes context creation with glvideomixer.
This commit is contained in:
Matthew Waters 2015-04-21 12:19:46 +10:00
parent 9827138061
commit 66a5cad6c1

View file

@ -484,6 +484,7 @@ gst_gl_base_mixer_decide_allocation (GstGLBaseMixer * mix, GstQuery * query)
_find_local_gl_context (mix); _find_local_gl_context (mix);
if (!mix->context) { if (!mix->context) {
GST_OBJECT_LOCK (mix->display);
do { do {
if (mix->context) if (mix->context)
gst_object_unref (mix->context); gst_object_unref (mix->context);
@ -497,6 +498,7 @@ gst_gl_base_mixer_decide_allocation (GstGLBaseMixer * mix, GstQuery * query)
goto context_error; goto context_error;
} }
} while (!gst_gl_display_add_context (mix->display, mix->context)); } while (!gst_gl_display_add_context (mix->display, mix->context));
GST_OBJECT_UNLOCK (mix->display);
} }
if (mix_class->decide_allocation) if (mix_class->decide_allocation)