[vlc-commits] direct3d9: use a version check with a better name to disable D3D9

Steve Lhomme git at videolan.org
Tue Jul 31 15:33:44 CEST 2018


vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Tue Jul 31 15:15:48 2018 +0200| [c0abd168d4e9c4d9f60112105da8b9ff5f1df74b] | committer: Steve Lhomme

direct3d9: use a version check with a better name to disable D3D9

The VersionHelpers API is available since Win2000

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

 modules/video_output/win32/direct3d9.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/modules/video_output/win32/direct3d9.c b/modules/video_output/win32/direct3d9.c
index d91daab237..2cb4141704 100644
--- a/modules/video_output/win32/direct3d9.c
+++ b/modules/video_output/win32/direct3d9.c
@@ -56,6 +56,7 @@
 #include "builtin_shaders.h"
 
 #include <assert.h>
+#include <versionhelpers.h>
 
 /*****************************************************************************
  * Module descriptor
@@ -253,9 +254,8 @@ static int Open(vlc_object_t *object)
     if ( !vd->obj.force && vd->source.mastering.max_luminance != 0)
         return VLC_EGENERIC; /* let a module who can handle it do it */
 
-    OSVERSIONINFO winVer;
-    winVer.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
-    if(GetVersionEx(&winVer) && winVer.dwMajorVersion < 6 && !object->obj.force)
+    /* do not use D3D9 on XP unless forced */
+    if(!object->obj.force && !IsWindowsVistaOrGreater())
         return VLC_EGENERIC;
 
     /* Allocate structure */



More information about the vlc-commits mailing list