From 68ecbc34f1cb29dfda116724c87d602eba961eb2 Mon Sep 17 00:00:00 2001 From: reimar Date: Sun, 13 Nov 2005 21:53:26 +0000 Subject: [PATCH] disable *SwapInterval function when extensions are missing, since it can cause crashes. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@16985 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libvo/gl_common.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/libvo/gl_common.c b/libvo/gl_common.c index d6a3a153ad..f23d0728e6 100644 --- a/libvo/gl_common.c +++ b/libvo/gl_common.c @@ -251,6 +251,7 @@ static void *setNull(const GLubyte *s) { * \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 @@ static void getFunctions(void *(*getProcAddress)(const GLubyte *)) { 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 @@ static void getFunctions(void *(*getProcAddress)(const GLubyte *)) { SwapInterval = getProcAddress("wglSwapIntervalEXT"); if (!SwapInterval) SwapInterval = getProcAddress("wglSwapIntervalSGI"); + } } /**