changeset 36225:b67bdb9304f8

Change hack to use a solution that will work more generally. The main reason is that matrixview vo has similar issues, and single buffering seems like a bad idea for that one.
author reimar
date Sun, 09 Jun 2013 22:03:50 +0000
parents c528b4f82e8b
children 68cbead2e8a5
files libvo/vo_gl.c
diffstat 1 files changed, 7 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/libvo/vo_gl.c	Sun Jun 09 21:34:24 2013 +0000
+++ b/libvo/vo_gl.c	Sun Jun 09 22:03:50 2013 +0000
@@ -701,16 +701,6 @@
   is_xyz = IMGFMT_IS_XYZ(image_format);
   glFindFormat(format, NULL, &gl_texfmt, &gl_format, &gl_type);
 
-  if (glctx.type == GLTYPE_OSX && vo_doublebuffering && !is_yuv) {
-    // doublebuffering causes issues when e.g. drawing yuy2 or rgb textures
-    // (nothing is draw) unless using glfinish which makes things slow.
-    // This is possibly because we do not actually request a double-buffered
-    // context.
-    // However single-buffering causes slowdown and artefacts when
-    // drawing planar formats. Mostly tested on PPC MacMini
-    mp_msg(MSGT_VO, MSGL_INFO, "[gl] -double not supported on OSX for interleaved formats, switching to -nodouble\n");
-    vo_doublebuffering = 0;
-  }
   vo_flipped = !!(flags & VOFLAG_FLIPPING);
 
   if (create_window(d_width, d_height, flags, title) < 0)
@@ -908,6 +898,13 @@
     do_render_osd(RENDER_OSD | RENDER_EOSD);
   }
   if (use_glFinish) mpglFinish();
+  else if (glctx.type == GLTYPE_OSX && vo_doublebuffering && !is_yuv)
+    // At least on PPC Mac Mini this combination leads to
+    // no image at all being show, however for the planar YUV
+    // case the flush causes a significant slowdown.
+    // Note that always using single-buffering is not a good solution since
+    // it causes artefacts with planar YUV.
+    mpglFlush();
 
   if (vo_doublebuffering) {
     glctx.swapGlBuffers(&glctx);