summaryrefslogtreecommitdiffstats
path: root/libvo
diff options
context:
space:
mode:
authorreimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2009-09-27 14:24:15 +0000
committerreimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2009-09-27 14:24:15 +0000
commitfe3b9a88ce62ab0e562b326d15f398a801ba1a92 (patch)
treeb143fc10483463ac2a222728734af5bf338d83c4 /libvo
parenta5abf5851cb9bfb12642460fc1d72066565bb4ea (diff)
downloadmpv-fe3b9a88ce62ab0e562b326d15f398a801ba1a92.tar.bz2
mpv-fe3b9a88ce62ab0e562b326d15f398a801ba1a92.tar.xz
Also check GLX client and server strings for extensions
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29721 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libvo')
-rw-r--r--libvo/gl_common.c29
1 files changed, 27 insertions, 2 deletions
diff --git a/libvo/gl_common.c b/libvo/gl_common.c
index b9ded01436..1bf8c906c3 100644
--- a/libvo/gl_common.c
+++ b/libvo/gl_common.c
@@ -1563,6 +1563,21 @@ static XVisualInfo *getWindowVisualInfo(Window win) {
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, GLXContext *context, Window win)
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, GLXContext *context, Window win)
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;