# HG changeset patch # User reimar # Date 1363542173 0 # Node ID b4047109a8bd544db5863a6bd292d844c48020ab # Parent ae62be3d8de2ec294d4e83006f7f9e132291998d Try to fix performance for -vo gl on OSX with planar YUV. diff -r ae62be3d8de2 -r b4047109a8bd libvo/vo_gl.c --- a/libvo/vo_gl.c Sun Mar 17 10:50:41 2013 +0000 +++ b/libvo/vo_gl.c Sun Mar 17 17:42:53 2013 +0000 @@ -712,6 +712,16 @@ is_yuv |= (xs << 8) | (ys << 16); 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) @@ -1390,14 +1400,6 @@ // rare feature, not worth creating a window to detect use_ycbcr = 0; } - if (glctx.type == GLTYPE_OSX && vo_doublebuffering) { - // doublebuffering causes issues when e.g. drawing yuy2 textures - // (nothing is draw) unless using glfinish which makes things slow. - // This is possibly because we do not actually request a double-buffered - // context. - mp_msg(MSGT_VO, MSGL_INFO, "[gl] -double not supported on OSX, switching to -nodouble\n"); - vo_doublebuffering = 0; - } if (many_fmts) mp_msg(MSGT_VO, MSGL_INFO, "[gl] using extended formats. " "Use -vo gl:nomanyfmts if playback fails.\n");