Author: tack
Date: Sun Apr 22 18:50:06 2007
New Revision: 2654

Modified:
   trunk/xine/setup.py
   trunk/xine/src/drivers/video_out_kaa.c
   trunk/xine/src/xine.c

Log:
Do not try to import glXGetVideoSyncSGI and glXWaitVideoSyncSGI but
rather find them via glXGetProcAddressARB.  Should be more portable (and
less nvidia-specific.)



Modified: trunk/xine/setup.py
==============================================================================
--- trunk/xine/setup.py (original)
+++ trunk/xine/setup.py Sun Apr 22 18:50:06 2007
@@ -67,12 +67,12 @@
         xineso.library_dirs.append(dir)
         print "+ X11 found in %s; X11 support enabled" % dir
 
-        glxtest_code = 'unsigned int count; glXWaitVideoSyncSGI(2, count, 
&count);'
-        if xineso.check_cc(['<GL/glx.h>'], glxtest_code, '-lGL 
-DGLX_GLXEXT_PROTOTYPES -Werror -L%s' % dir):
+        glxtest_code = 'glXGetProcAddressARB((unsigned char 
*)"glXWaitVideoSyncSGI");'
+        if xineso.check_cc(['<GL/glx.h>'], glxtest_code, '-lGL -Werror -L%s' % 
dir):
             config.define("HAVE_OPENGL_VSYNC")
-            print "+ OpenGL vsync support enabled"
+            print "+ Runtime OpenGL vsync detection enabled"
         else:
-            print "- OpenGL vsync support disabled"
+            print "- Runtime OpenGL vsync detection disabled (no 
glXGetProcAddressARB in libGL)"
         break
 else:
     print "- X11 not found; disabling X11 support."

Modified: trunk/xine/src/drivers/video_out_kaa.c
==============================================================================
--- trunk/xine/src/drivers/video_out_kaa.c      (original)
+++ trunk/xine/src/drivers/video_out_kaa.c      Sun Apr 22 18:50:06 2007
@@ -1075,9 +1075,12 @@
         return;
 
     xt = glXQueryExtensionsString(vis->display, vis->screen);
-    if (!xt || !strstr(xt, "GLX_SGI_video_sync"))
+    if (!xt || !strstr(xt, "GLX_SGI_video_sync")) {
+        printf("OpenGL vsync not supported on this system (no 
GLX_SGI_video_sync)\n");
         return;
+    }
 
+    printf("OpenGL vsync supported on this system.\n");
     XVisualInfo *vi = glXChooseVisual(vis->display, 0, attribList);
     if (vi) {
         this->glx_context = glXCreateContext(vis->display, vi, None, GL_TRUE);

Modified: trunk/xine/src/xine.c
==============================================================================
--- trunk/xine/src/xine.c       (original)
+++ trunk/xine/src/xine.c       Sun Apr 22 18:50:06 2007
@@ -308,7 +308,7 @@
 PyObject *
 Xine_PyObject_get_log(Xine_PyObject *self, PyObject *args, PyObject *kwargs)
 {
-    const char *const *list;
+    char *const *list;
     PyObject *pylist = NULL;
     int i, section;
 
@@ -759,13 +759,16 @@
 {
     void *handle = dlopen("libGL.so", RTLD_LAZY);
     if (handle) {
-        glXWaitVideoSyncSGI = dlsym(handle, "glXWaitVideoSyncSGI");
-        glXGetVideoSyncSGI = dlsym(handle, "glXGetVideoSyncSGI");
+        void *(*glXGetProcAddressARB)(unsigned char *) = NULL;
+        glXGetProcAddressARB = (void *(*)(unsigned char *))dlsym(handle, 
"glXGetProcAddressARB");
+        if (glXGetProcAddressARB) {
+            glXWaitVideoSyncSGI = (void *)glXGetProcAddressARB((unsigned char 
*)"glXWaitVideoSyncSGI");
+            glXGetVideoSyncSGI = (void *)glXGetProcAddressARB((unsigned char 
*)"glXGetVideoSyncSGI");
+        }
+
     }
-    if (glXWaitVideoSyncSGI && glXGetVideoSyncSGI)
-        printf("OpenGL vsync supported on this system.\n");
-    else
-        printf("OpenGL vsync not supported on this system.\n");
+    if (!glXWaitVideoSyncSGI || !glXGetVideoSyncSGI)
+        printf("Failed to find addresses for glXWaitVideoSyncSGI and 
glXGetVideoSyncSGI\n");
 
 }
 #endif

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Freevo-cvslog mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freevo-cvslog

Reply via email to