--- video/out/vo_opengl.c.orig +++ video/out/vo_opengl.c @@ -24,6 +24,10 @@ #include #include +#ifdef __APPLE__ +#include +#endif + #include #include "config.h" @@ -81,8 +85,10 @@ struct gl_priv { int last_pattern; int matches, mismatches; +#if !defined(__APPLE__) || MAC_OS_X_VERSION_MAX_ALLOWED >= 1070 GLsync vsync_fences[NUM_VSYNC_FENCES]; int num_vsync_fences; +#endif }; static void resize(struct gl_priv *p) @@ -124,11 +130,13 @@ static void draw_frame(struct vo *vo, st mpgl_start_frame(p->glctx); +#if !defined(__APPLE__) || MAC_OS_X_VERSION_MAX_ALLOWED >= 1070 if (gl->FenceSync && p->num_vsync_fences < p->opts.vsync_fences) { GLsync fence = gl->FenceSync(GL_SYNC_GPU_COMMANDS_COMPLETE, 0);; if (fence) p->vsync_fences[p->num_vsync_fences++] = fence; } +#endif gl_video_render_frame(p->renderer, frame, p->glctx->main_fb); @@ -167,11 +175,13 @@ static void flip_page(struct vo *vo) p->opts.pattern[0] = 0; } } +#if !defined(__APPLE__) || MAC_OS_X_VERSION_MAX_ALLOWED >= 1070 while (p->opts.vsync_fences > 0 && p->num_vsync_fences >= p->opts.vsync_fences) { gl->ClientWaitSync(p->vsync_fences[0], GL_SYNC_FLUSH_COMMANDS_BIT, 1e9); gl->DeleteSync(p->vsync_fences[0]); MP_TARRAY_REMOVE_AT(p->vsync_fences, p->num_vsync_fences, 0); } +#endif } static int query_format(struct vo *vo, int format)