[MPlayer-cvslog] r29721 - trunk/libvo/gl_common.c

reimar subversion at mplayerhq.hu
Sun Sep 27 16:24:15 CEST 2009


Author: reimar
Date: Sun Sep 27 16:24:15 2009
New Revision: 29721

Log:
Also check GLX client and server strings for extensions

Modified:
   trunk/libvo/gl_common.c

Modified: trunk/libvo/gl_common.c
==============================================================================
--- trunk/libvo/gl_common.c	Sat Sep 26 23:22:01 2009	(r29720)
+++ trunk/libvo/gl_common.c	Sun Sep 27 16:24:15 2009	(r29721)
@@ -1563,6 +1563,21 @@ static XVisualInfo *getWindowVisualInfo(
   return XGetVisualInfo(mDisplay, VisualIDMask, &vinfo_template, &tmp);
 }
 
+static void appendstr(char **dst, const char *str)
+{
+    int newsize;
+    char *newstr;
+    if (!str)
+        return;
+    newsize = strlen(*dst) + 1 + strlen(str) + 1;
+    newstr = realloc(*dst, newsize);
+    if (!newstr)
+        return;
+    *dst = newstr;
+    strcat(*dst, " ");
+    strcat(*dst, str);
+}
+
 /**
  * \brief Changes the window in which video is displayed.
  * If possible only transfers the context to the new window, otherwise
@@ -1619,6 +1634,7 @@ int setGlWindow(XVisualInfo **vinfo, GLX
   if (!keep_context) {
     void *(*getProcAddress)(const GLubyte *);
     const char *(*glXExtStr)(Display *, int);
+    char *glxstr = strdup("");
     if (*context)
       glXDestroyContext(mDisplay, *context);
     *context = new_context;
@@ -1631,8 +1647,17 @@ int setGlWindow(XVisualInfo **vinfo, GLX
     if (!getProcAddress)
       getProcAddress = (void *)getdladdr;
     glXExtStr = getdladdr("glXQueryExtensionsString");
-    getFunctions(getProcAddress, !glXExtStr ? NULL :
-                 glXExtStr(mDisplay, DefaultScreen(mDisplay)));
+    if (glXExtStr)
+        appendstr(&glxstr, glXExtStr(mDisplay, DefaultScreen(mDisplay)));
+    glXExtStr = getdladdr("glXGetClientString");
+    if (glXExtStr)
+        appendstr(&glxstr, glXExtStr(mDisplay, GLX_EXTENSIONS));
+    glXExtStr = getdladdr("glXGetServerString");
+    if (glXExtStr)
+        appendstr(&glxstr, glXExtStr(mDisplay, GLX_EXTENSIONS));
+
+    getFunctions(getProcAddress, glxstr);
+    free(glxstr);
 
     // and inform that reinit is neccessary
     return SET_WINDOW_REINIT;


More information about the MPlayer-cvslog mailing list