From 9de8730dc926be1a2875117a05d5f3005dbaf39a Mon Sep 17 00:00:00 2001 From: wm4 Date: Sun, 1 Nov 2015 20:45:53 +0100 Subject: 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.) --- video/out/opengl/w32.c | 5 +++++ 1 file changed, 5 insertions(+) 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; -- cgit v1.2.3