[MPlayer-cvslog] CVS: main/libvo vo_gl2.c,1.75,1.76

Reimar Döffinger CVS syncmail at mplayerhq.hu
Tue Sep 13 18:16:16 CEST 2005


CVS change done by Reimar Döffinger CVS

Update of /cvsroot/mplayer/main/libvo
In directory mail:/var2/tmp/cvs-serv9566

Modified Files:
	vo_gl2.c 
Log Message:
Allow disabling the glFinish call


Index: vo_gl2.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/vo_gl2.c,v
retrieving revision 1.75
retrieving revision 1.76
diff -u -r1.75 -r1.76
--- vo_gl2.c	25 Aug 2005 12:45:57 -0000	1.75
+++ vo_gl2.c	13 Sep 2005 16:16:13 -0000	1.76
@@ -10,6 +10,7 @@
 
 #include "config.h"
 #include "mp_msg.h"
+#include "subopt-helper.h"
 #include "video_out.h"
 #include "video_out_internal.h"
 #include "sub.h"
@@ -70,6 +71,7 @@
 
 static int      gl_bilinear=1;
 static int      gl_antialias=0;
+static int      use_glFinish;
 
 static void (*draw_alpha_fnc)
                  (int x0,int y0, int w,int h, unsigned char* src, unsigned char *srca, int stride);
@@ -891,6 +893,7 @@
   drawTextureDisplay();
 
 //  glFlush();
+  if (use_glFinish)
   glFinish();
 #ifdef GL_WIN32
   SwapBuffers(vo_hdc);
@@ -951,13 +954,25 @@
 #endif
 }
 
+static opt_t subopts[] = {
+  {"glfinish",     OPT_ARG_BOOL, &use_glFinish, NULL},
+  {NULL}
+};
+
 static int preinit(const char *arg)
 {
-    if(arg) 
-    {
-	mp_msg(MSGT_VO, MSGL_FATAL, "[gl2] Unknown subdevice: %s\n",arg);
-	return -1;
-    }
+  // set defaults
+  use_glFinish = 1;
+  if (subopt_parse(arg, subopts) != 0) {
+    mp_msg(MSGT_VO, MSGL_FATAL,
+            "\n-vo gl2 command line help:\n"
+            "Example: mplayer -vo gl2:noglfinish\n"
+            "\nOptions:\n"
+            "  noglfinish\n"
+            "    Do not call glFinish() before swapping buffers\n"
+            "\n" );
+    return -1;
+  }
     if( !vo_init() ) return -1; // Can't open X11
     return 0;
 }




More information about the MPlayer-cvslog mailing list