glstereosplit: use gst_display_ensure_context

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3843>
This commit is contained in:
Anders Hellerup Madsen 2023-02-06 16:16:14 +01:00
parent f0040149a0
commit acb8f2ee5d

View file

@ -528,23 +528,9 @@ ensure_context_unlocked (GstGLStereoSplit * self)
_find_local_gl_context_unlocked (self);
if (!self->context) {
GST_OBJECT_LOCK (self->display);
do {
if (self->context)
gst_object_unref (self->context);
/* just get a GL context. we don't care */
self->context =
gst_gl_display_get_gl_context_for_thread (self->display, NULL);
if (!self->context) {
if (!gst_gl_display_create_context (self->display, self->other_context,
&self->context, &error)) {
GST_OBJECT_UNLOCK (self->display);
goto context_error;
}
}
} while (!gst_gl_display_add_context (self->display, self->context));
GST_OBJECT_UNLOCK (self->display);
if (!gst_gl_display_ensure_context (self->display, self->other_context,
&self->context, &error)) {
goto context_error;
}
{