summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2015-11-01 20:45:53 +0100
committerwm4 <wm4@nowhere>2015-11-01 20:50:41 +0100
commit9de8730dc926be1a2875117a05d5f3005dbaf39a (patch)
treeb93a40f74f8d198d9239a7d9cbf0d204456ccec6
parent30a61064773e4fcb4c20a90787af95bc7d0e6d12 (diff)
downloadmpv-9de8730dc926be1a2875117a05d5f3005dbaf39a.tar.bz2
mpv-9de8730dc926be1a2875117a05d5f3005dbaf39a.tar.xz
vo_opengl: win32: always request MMCSS for DWM
Quoting MSDN: "Notifies the Desktop Window Manager (DWM) to opt in to or out of Multimedia Class Schedule Service (MMCSS) scheduling while the calling process is alive.". Whatever this means. (An application can change the scheduling priority of the window manager?) Does this improve anything? I have no idea. Certainly this is a program that does multimedia and graphics, so we seem to be a good match for this. Is it bad if we enable this even while playback is inactive or paused? I have no idea either. Is there a magic cargo cult function that will mark our renderer thread as multimedia thing? I have no idea. (We use a function to enable MMCSS for our audio thread in ao_wasapi.)
-rw-r--r--video/out/opengl/w32.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/video/out/opengl/w32.c b/video/out/opengl/w32.c
index 8365a3933c..fc789619c8 100644
--- a/video/out/opengl/w32.c
+++ b/video/out/opengl/w32.c
@@ -262,6 +262,8 @@ static int w32_init(struct MPGLContext *ctx, int flags)
current_w32_context = w32_ctx;
wglMakeCurrent(w32_ctx->hdc, w32_ctx->context);
+ if (w32_ctx->pDwmEnableMMCSS)
+ w32_ctx->pDwmEnableMMCSS(TRUE);
return 0;
fail:
@@ -295,6 +297,9 @@ static void w32_uninit(MPGLContext *ctx)
wglMakeCurrent(w32_ctx->hdc, 0);
vo_w32_run_on_thread(ctx->vo, destroy_gl, ctx);
+ if (w32_ctx->pDwmEnableMMCSS)
+ w32_ctx->pDwmEnableMMCSS(FALSE);
+
if (w32_ctx->dwmapi_dll)
FreeLibrary(w32_ctx->dwmapi_dll);
w32_ctx->dwmapi_dll = NULL;