diff options
author | Akemi <der.richter@gmx.de> | 2017-12-28 12:42:02 +0100 |
---|---|---|
committer | Kevin Mitchell <kevmitch@gmail.com> | 2018-02-12 04:49:15 -0800 |
commit | abf2efb107f7bee329dfd0c89573f70bc4bd7c69 (patch) | |
tree | 9c62b935580d25c42600c344c782fb664a8fc5bd /video/out/opengl | |
parent | f670c64e59119fc91675d8eccf1e350365ee2f55 (diff) | |
download | mpv-abf2efb107f7bee329dfd0c89573f70bc4bd7c69.tar.bz2 mpv-abf2efb107f7bee329dfd0c89573f70bc4bd7c69.tar.xz |
osx: always deactivate the early opengl flush on macOS
early flushing only caused problems on macOS, which includes:
- performance problems and huge amount of dropped frames
- problems with playing back video files with fps close to the display
refresh rate
- rendering at twice the rate of the video fps
- not properly detected display refresh rate
we always deactivate any early flush for macOS to fix these problems.
Diffstat (limited to 'video/out/opengl')
-rw-r--r-- | video/out/opengl/context_cocoa.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/video/out/opengl/context_cocoa.c b/video/out/opengl/context_cocoa.c index 129999932e..da20f400b2 100644 --- a/video/out/opengl/context_cocoa.c +++ b/video/out/opengl/context_cocoa.c @@ -36,6 +36,7 @@ const struct m_sub_options cocoa_conf = { struct priv { GL gl; + void (GLAPIENTRY *Flush)(void); CGLPixelFormatObj pix; CGLContextObj ctx; @@ -49,6 +50,8 @@ static int set_swap_interval(int enabled) return (err == kCGLNoError) ? 0 : -1; } +static void glFlushDummy(void) { } + static void *cocoa_glgetaddr(const char *s) { void *ret = NULL; @@ -138,6 +141,8 @@ static bool create_gl_context(struct ra_ctx *ctx) mpgl_load_functions(gl, (void *)cocoa_glgetaddr, NULL, ctx->vo->log); gl->SwapInterval = set_swap_interval; + p->Flush = gl->Flush; + gl->Flush = glFlushDummy; CGLReleasePixelFormat(p->pix); @@ -155,9 +160,8 @@ static void cocoa_uninit(struct ra_ctx *ctx) static void cocoa_swap_buffers(struct ra_ctx *ctx) { struct priv *p = ctx->priv; - GL *gl = &p->gl; vo_cocoa_swap_buffers(ctx->vo); - gl->Flush(); + p->Flush(); } static bool cocoa_init(struct ra_ctx *ctx) |