[287/906] fix a regression about glXChooseVisual which failed when using mesa, so...
authorjulien <julien@julien-desktop.(none)>
Sun, 14 Dec 2008 00:36:32 +0000 (19:36 -0500)
committerTim-Philipp Müller <tim@centricular.com>
Sat, 9 Dec 2017 19:31:20 +0000 (19:31 +0000)
gst-libs/gst/gl/gstglwindow_x11.c

index e728239..b98aac4 100644 (file)
@@ -251,16 +251,8 @@ gst_gl_window_new (gint width, gint height)
 
   gint attrib[] = {
     GLX_RGBA,
-    GLX_RED_SIZE, 8, GLX_GREEN_SIZE, 8, GLX_BLUE_SIZE, 8,
+    GLX_RED_SIZE, 1, GLX_GREEN_SIZE, 1, GLX_BLUE_SIZE, 1,
     GLX_DOUBLEBUFFER,
-    GLX_DEPTH_SIZE, 8,
-    GLX_ALPHA_SIZE, 8,
-    GLX_STENCIL_SIZE, 8,
-    GLX_ACCUM_RED_SIZE, 8,
-    GLX_ACCUM_GREEN_SIZE, 8,
-    GLX_ACCUM_BLUE_SIZE, 8,
-    GLX_ACCUM_ALPHA_SIZE, 8,
-    GLX_LEVEL, 0,
     None
   };
 
@@ -322,6 +314,12 @@ gst_gl_window_new (gint width, gint height)
 
   priv->visual_info = glXChooseVisual (priv->device, priv->screen_num, attrib);
 
+  if (!priv->visual_info)
+  {
+    g_warning ("glx visual is null (bad attributes)\n");
+    return NULL;
+  }
+
   if (priv->visual_info->visual != priv->visual)
     g_debug ("selected visual is different from the default\n");