[MPlayer-cvslog] CVS: main/libvo gl_common.c,1.33,1.34

Reimar Döffinger CVS syncmail at mplayerhq.hu
Sun Nov 13 22:53:28 CET 2005


CVS change done by Reimar Döffinger CVS

Update of /cvsroot/mplayer/main/libvo
In directory mail:/var2/tmp/cvs-serv1718

Modified Files:
	gl_common.c 
Log Message:
disable *SwapInterval function when extensions are missing, since it
can cause crashes.


Index: gl_common.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/gl_common.c,v
retrieving revision 1.33
retrieving revision 1.34
diff -u -r1.33 -r1.34
--- gl_common.c	7 Nov 2005 21:29:38 -0000	1.33
+++ gl_common.c	13 Nov 2005 21:53:26 -0000	1.34
@@ -251,6 +251,7 @@
  * \param getProcAddress function to resolve function names, may be NULL
  */
 static void getFunctions(void *(*getProcAddress)(const GLubyte *)) {
+  const char *extensions = glGetString(GL_EXTENSIONS);
   if (!getProcAddress)
     getProcAddress = setNull;
   GenBuffers = getProcAddress("glGenBuffers");
@@ -323,6 +324,9 @@
     ProgramEnvParameter4f = getProcAddress("glProgramEnvParameter4fARB");
   if (!ProgramEnvParameter4f)
     ProgramEnvParameter4f = getProcAddress("glProgramEnvParameter4fNV");
+  if (!extensions || !strstr(extensions, "_swap_control"))
+    SwapInterval = NULL;
+  else {
   SwapInterval = getProcAddress("glXSwapInterval");
   if (!SwapInterval)
     SwapInterval = getProcAddress("glXSwapIntervalEXT");
@@ -334,6 +338,7 @@
     SwapInterval = getProcAddress("wglSwapIntervalEXT");
   if (!SwapInterval)
     SwapInterval = getProcAddress("wglSwapIntervalSGI");
+  }
 }
 
 /**




More information about the MPlayer-cvslog mailing list