changeset 16235:6a72f27e88d5

Make glFinish optional
author reimar
date Tue, 16 Aug 2005 18:27:12 +0000
parents 31660114d885
children 042f5c461c44
files DOCS/man/en/mplayer.1 libvo/vo_gl.c
diffstat 2 files changed, 9 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/DOCS/man/en/mplayer.1	Tue Aug 16 18:19:06 2005 +0000
+++ b/DOCS/man/en/mplayer.1	Tue Aug 16 18:27:12 2005 +0000
@@ -2704,6 +2704,9 @@
 1: Use texture_rectangle.
 .br
 2: Use texture_non_power_of_two.
+.IPs (no)glfinish
+Call glFinish() before swapping buffers.
+Slower but in some cases more correct output (default: disabled).
 .REss
 .RE
 .PD 1
--- a/libvo/vo_gl.c	Tue Aug 16 18:19:06 2005 +0000
+++ b/libvo/vo_gl.c	Tue Aug 16 18:27:12 2005 +0000
@@ -61,6 +61,7 @@
 static uint32_t image_width;
 static uint32_t image_height;
 static int many_fmts;
+static int use_glFinish;
 static GLenum gl_target;
 static GLenum gl_texfmt;
 static GLenum gl_format;
@@ -403,6 +404,7 @@
   }
 
 //  glFlush();
+  if (use_glFinish)
   glFinish();
 #ifdef GL_WIN32
   SwapBuffers(vo_hdc);
@@ -513,6 +515,7 @@
   {"aspect",       OPT_ARG_BOOL, &use_aspect,   NULL},
   {"slice-height", OPT_ARG_INT,  &slice_height, (opt_test_f)int_non_neg},
   {"rectangle",    OPT_ARG_INT,  &use_rectangle,(opt_test_f)int_non_neg},
+  {"glfinish",     OPT_ARG_BOOL, &use_glFinish, NULL},
   {NULL}
 };
 
@@ -524,6 +527,7 @@
     scaled_osd = 0;
     use_aspect = 1;
     use_rectangle = 0;
+    use_glFinish = 0;
     slice_height = 4;
     if (subopt_parse(arg, subopts) != 0) {
       mp_msg(MSGT_VO, MSGL_FATAL,
@@ -542,6 +546,8 @@
               "    0: use power-of-two textures\n"
               "    1: use texture_rectangle\n"
               "    2: use texture_non_power_of_two\n"
+              "  glfinish\n"
+              "    Call glFinish() before swapping buffers\n"
               "\n" );
       return -1;
     }