From ecd9a4e37c8633243e4c6e06c2e7d77047d5c50b Mon Sep 17 00:00:00 2001 From: Anders Hellerup Madsen Date: Mon, 6 Feb 2023 16:15:06 +0100 Subject: [PATCH] glbasemixer: use gst_display_ensure_context Part-of: --- .../gst-plugins-base/ext/gl/gstglbasemixer.c | 22 +++---------------- 1 file changed, 3 insertions(+), 19 deletions(-) diff --git a/subprojects/gst-plugins-base/ext/gl/gstglbasemixer.c b/subprojects/gst-plugins-base/ext/gl/gstglbasemixer.c index c3fac257ab..016563725e 100644 --- a/subprojects/gst-plugins-base/ext/gl/gstglbasemixer.c +++ b/subprojects/gst-plugins-base/ext/gl/gstglbasemixer.c @@ -186,26 +186,10 @@ _get_gl_context_unlocked (GstGLBaseMixer * mix) _find_local_gl_context_unlocked (mix); - GST_OBJECT_LOCK (mix->display); - if (!mix->context) { - do { - if (mix->context) { - gst_object_unref (mix->context); - mix->context = NULL; - } - /* just get a GL context. we don't care */ - mix->context = - gst_gl_display_get_gl_context_for_thread (mix->display, NULL); - if (!mix->context) { - if (!gst_gl_display_create_context (mix->display, - mix->priv->other_context, &mix->context, &error)) { - GST_OBJECT_UNLOCK (mix->display); - goto context_error; - } - } - } while (!gst_gl_display_add_context (mix->display, mix->context)); + if (!gst_gl_display_ensure_context (mix->display, mix->priv->other_context, + &mix->context, &error)) { + goto context_error; } - GST_OBJECT_UNLOCK (mix->display); if (new_context || !mix->priv->gl_started) { if (mix->priv->gl_started)