[vlc-commits] GLX: glXSwapIntervalEXT() returns void so ignore return value

Rémi Denis-Courmont git at videolan.org
Sat Mar 17 10:31:51 CET 2012


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sat Mar 17 11:28:44 2012 +0200| [9cf66c2856ab3a209fe15ec5662a8cd927ee20bc] | committer: Rémi Denis-Courmont

GLX: glXSwapIntervalEXT() returns void so ignore return value

glXSwapIntervalEXT() does not return a value, contrary to the
SGI equivalent. In case of error, the X11 error handler is used.

This patch fixes compilation with conforming headers. It should still
be compatible with buggy Mesa headers where 'int' is returned.

For reference, see the specification here:
http://www.opengl.org/registry/specs/EXT/swap_control.txt
http://www.opengl.org/registry/api/glxext.h

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=9cf66c2856ab3a209fe15ec5662a8cd927ee20bc
---

 modules/video_output/xcb/glx.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/modules/video_output/xcb/glx.c b/modules/video_output/xcb/glx.c
index 5e5c043..4f9b933 100644
--- a/modules/video_output/xcb/glx.c
+++ b/modules/video_output/xcb/glx.c
@@ -381,7 +381,10 @@ static int Open (vlc_object_t *obj)
     if (HasExtension (glx_extensions, "GLX_EXT_swap_control")) {
         PFNGLXSWAPINTERVALEXTPROC SwapIntervalEXT = (PFNGLXSWAPINTERVALEXTPROC)GetProcAddress (NULL, "glXSwapIntervalEXT");
         if (!is_swap_interval_set && SwapIntervalEXT)
-            is_swap_interval_set = !SwapIntervalEXT (dpy, sys->glwin, 1);
+        {
+            SwapIntervalEXT (dpy, sys->glwin, 1);
+            is_swap_interval_set = true;
+        }
     }
 #endif
 



More information about the vlc-commits mailing list