From 47f3f98366618cea3e8002ad272cda8a4ec42d2a Mon Sep 17 00:00:00 2001 From: Julien Isorce Date: Tue, 21 Jul 2015 11:23:21 +0100 Subject: [PATCH] gstglwidget: use gst_gl_display_create_context Also handle the failure case. https://bugzilla.gnome.org/show_bug.cgi?id=750310 --- ext/gtk/gtkgstglwidget.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/ext/gtk/gtkgstglwidget.c b/ext/gtk/gtkgstglwidget.c index f8b8d26..378632c 100644 --- a/ext/gtk/gtkgstglwidget.c +++ b/ext/gtk/gtkgstglwidget.c @@ -530,6 +530,7 @@ gboolean gtk_gst_gl_widget_init_winsys (GtkGstGLWidget * gst_widget) { GtkGstGLWidgetPrivate *priv = gst_widget->priv; + GError *error = NULL; g_return_val_if_fail (GTK_IS_GST_GL_WIDGET (gst_widget), FALSE); @@ -551,15 +552,13 @@ gtk_gst_gl_widget_init_winsys (GtkGstGLWidget * gst_widget) return FALSE; } - priv->context = gst_gl_context_new (priv->display); - - if (!priv->context) { + if (!gst_gl_display_create_context (priv->display, priv->other_context, + &priv->context, &error)) { + g_clear_error (&error); GTK_GST_BASE_WIDGET_UNLOCK (gst_widget); return FALSE; } - gst_gl_context_create (priv->context, priv->other_context, NULL); - GTK_GST_BASE_WIDGET_UNLOCK (gst_widget); return TRUE; } -- 2.7.4