summaryrefslogtreecommitdiffstats
path: root/libvo/gl_common.c
diff options
context:
space:
mode:
authorUoti Urpala <uau@glyph.nonexistent.invalid>2009-10-06 04:28:59 +0300
committerUoti Urpala <uau@glyph.nonexistent.invalid>2009-10-06 04:48:00 +0300
commit7fd3eb0f74e7986e07556077ed654bad7869add8 (patch)
tree8d293145c0ef2bc31ca63f79dccb4e3b57294c82 /libvo/gl_common.c
parentef438b3a6b5bc714d521dd46d3ccb798ecd31eed (diff)
parentcbbc886820e981f488660708678f528e1d243121 (diff)
downloadmpv-7fd3eb0f74e7986e07556077ed654bad7869add8.tar.bz2
mpv-7fd3eb0f74e7986e07556077ed654bad7869add8.tar.xz
Merge svn changes up to r29752
As part of merging subtitle-in-terminal changes make update_subtitles() only clear existing subtitles if called with the reset argument, and not try to set new ones. Later calls should set the needed new subtitles, and this change avoids some problems with trying to set subtitles when mp_property_sub() in command.c gets called from initialization code before full initialization.
Diffstat (limited to 'libvo/gl_common.c')
-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 bb351f90d6..f827771a97 100644
--- a/libvo/gl_common.c
+++ b/libvo/gl_common.c
@@ -1564,6 +1564,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
@@ -1620,6 +1635,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;
@@ -1632,8 +1648,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;