vlc/vlc-3.0 | branch: master | Steve Lhomme <[email protected]> | Mon Oct 15 
13:07:30 2018 +0200| [d8c6b239d0faa026831ad6cadaf441beb2e46b87] | committer: 
Steve Lhomme

direct3d11: don't use the flip model before Win8.1

It's supported but Win7 can still use the d3d11 output.

(cherry picked from commit e544360e0bd57bc1d979d260b1ad2098331f1fc1)

> http://git.videolan.org/gitweb.cgi/vlc/vlc-3.0.git/?a=commit;h=d8c6b239d0faa026831ad6cadaf441beb2e46b87
---

 modules/video_output/win32/direct3d11.c | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/modules/video_output/win32/direct3d11.c 
b/modules/video_output/win32/direct3d11.c
index 339dfef07c..54bbc9d191 100644
--- a/modules/video_output/win32/direct3d11.c
+++ b/modules/video_output/win32/direct3d11.c
@@ -762,7 +762,19 @@ static void FillSwapChainDesc(vout_display_t *vd, 
DXGI_SWAP_CHAIN_DESC1 *out)
     if (isWin10OrGreater)
         out->SwapEffect = DXGI_SWAP_EFFECT_FLIP_DISCARD;
     else
-        out->SwapEffect = DXGI_SWAP_EFFECT_FLIP_SEQUENTIAL;
+    {
+        bool isWin81OrGreater = false;
+        HMODULE hKernel32 = GetModuleHandle(TEXT("kernel32.dll"));
+        if (likely(hKernel32 != NULL))
+            isWin81OrGreater = GetProcAddress(hKernel32, "IsProcessCritical") 
!= NULL;
+        if (isWin81OrGreater)
+            out->SwapEffect = DXGI_SWAP_EFFECT_FLIP_SEQUENTIAL;
+        else
+        {
+            out->SwapEffect = DXGI_SWAP_EFFECT_DISCARD;
+            out->BufferCount = 1;
+        }
+    }
 }
 #endif
 

_______________________________________________
vlc-commits mailing list
[email protected]
https://mailman.videolan.org/listinfo/vlc-commits

Reply via email to