summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--libvo/cocoa_common.h3
-rw-r--r--libvo/cocoa_common.m6
-rw-r--r--libvo/gl_common.c2
3 files changed, 11 insertions, 0 deletions
diff --git a/libvo/cocoa_common.h b/libvo/cocoa_common.h
index a69f61916c..4fbbb32dd9 100644
--- a/libvo/cocoa_common.h
+++ b/libvo/cocoa_common.h
@@ -16,4 +16,7 @@ void vo_cocoa_swap_buffers(void);
int vo_cocoa_check_events(struct vo *vo);
void vo_cocoa_fullscreen(struct vo *vo);
+// returns an int to conform to the gl extensions from other platforms
+int vo_cocoa_swap_interval(int enabled);
+
#endif /* MPLAYER_COCOA_COMMON_H */
diff --git a/libvo/cocoa_common.m b/libvo/cocoa_common.m
index c509dbcf39..5658ecb7bf 100644
--- a/libvo/cocoa_common.m
+++ b/libvo/cocoa_common.m
@@ -262,6 +262,12 @@ void vo_cocoa_fullscreen(struct vo *vo)
resize_window(vo);
}
+int vo_cocoa_swap_interval(int enabled)
+{
+ [s->glContext setValues:&enabled forParameter:NSOpenGLCPSwapInterval];
+ return 0;
+}
+
void create_menu()
{
NSMenu *menu;
diff --git a/libvo/gl_common.c b/libvo/gl_common.c
index d9814c6f6a..7cca800d40 100644
--- a/libvo/gl_common.c
+++ b/libvo/gl_common.c
@@ -1625,6 +1625,8 @@ static int setGlWindow_cocoa(MPGLContext *ctx)
{
vo_cocoa_change_attributes(ctx->vo);
getFunctions(ctx->gl, (void *)getdladdr, NULL);
+ if (!ctx->gl->SwapInterval)
+ ctx->gl->SwapInterval = vo_cocoa_swap_interval;
return SET_WINDOW_OK;
}