summaryrefslogtreecommitdiffstats
path: root/video/out/vo_opengl.c
diff options
context:
space:
mode:
authorAvi Halachmi (:avih) <avihpit@yahoo.com>2015-03-17 01:15:28 +0200
committerwm4 <wm4@nowhere>2015-04-09 20:36:35 +0200
commit843bc822a8a7974c7fbeea62525cb56bbab23fde (patch)
tree0ce52c36cbae7804ce12d922c3bddc6bcb0dda25 /video/out/vo_opengl.c
parentc97f014576143c706e9d5189a89fa9959a651c71 (diff)
downloadmpv-843bc822a8a7974c7fbeea62525cb56bbab23fde.tar.bz2
mpv-843bc822a8a7974c7fbeea62525cb56bbab23fde.tar.xz
opengl: win32 - add option 'dwmflush' to sync in DWM
This could help in cases where the DWM (Windows desktop compositor) adds another layer of bufferring and therefore the SwapBuffers timing could get messed up. Signed-off-by: wm4 <wm4@nowhere>
Diffstat (limited to 'video/out/vo_opengl.c')
-rw-r--r--video/out/vo_opengl.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/video/out/vo_opengl.c b/video/out/vo_opengl.c
index 589ae7b0db..fb47464e9a 100644
--- a/video/out/vo_opengl.c
+++ b/video/out/vo_opengl.c
@@ -72,6 +72,9 @@ struct gl_priv {
int use_gl_debug;
int allow_sw;
int swap_interval;
+ int current_swap_interval;
+ int dwm_flush;
+
char *backend;
int vo_flipped;
@@ -154,6 +157,12 @@ static void flip_page(struct vo *vo)
}
}
+ if (p->glctx->DwmFlush) {
+ p->current_swap_interval = p->glctx->DwmFlush(p->glctx, p->dwm_flush,
+ p->swap_interval,
+ p->current_swap_interval);
+ }
+
mpgl_unlock(p->glctx);
}
@@ -463,6 +472,7 @@ static int preinit(struct vo *vo)
} else {
MP_VERBOSE(vo, "swap_control extension missing.\n");
}
+ p->current_swap_interval = p->swap_interval;
p->renderer = gl_video_init(p->gl, vo->log);
if (!p->renderer)
@@ -498,6 +508,7 @@ static const struct m_option options[] = {
OPT_FLAG("glfinish", use_glFinish, 0),
OPT_FLAG("waitvsync", waitvsync, 0),
OPT_INT("swapinterval", swap_interval, 0, OPTDEF_INT(1)),
+ OPT_INT("dwmflush", dwm_flush, 0, OPTDEF_INT(0)),
OPT_FLAG("debug", use_gl_debug, 0),
OPT_STRING_VALIDATE("backend", backend, 0, mpgl_validate_backend_opt),
OPT_FLAG("sw", allow_sw, 0),