[vlc-commits] d3d11va: make the OS detection not dependent on the app manifest
Steve Lhomme
git at videolan.org
Tue Aug 7 14:18:16 CEST 2018
vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Tue Aug 7 14:18:04 2018 +0200| [c54494b4551bc5d421ab0d33814b6aa65b6ab4bb] | committer: Steve Lhomme
d3d11va: make the OS detection not dependent on the app manifest
hopefully the location won't change in future Windows versions
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=c54494b4551bc5d421ab0d33814b6aa65b6ab4bb
---
modules/codec/avcodec/d3d11va.c | 13 +++++++++++--
1 file changed, 11 insertions(+), 2 deletions(-)
diff --git a/modules/codec/avcodec/d3d11va.c b/modules/codec/avcodec/d3d11va.c
index 6e5fc20f44..9e3a7106ee 100644
--- a/modules/codec/avcodec/d3d11va.c
+++ b/modules/codec/avcodec/d3d11va.c
@@ -321,9 +321,18 @@ static int Open(vlc_va_t *va, AVCodecContext *ctx, enum PixelFormat pix_fmt,
if (pix_fmt != AV_PIX_FMT_D3D11VA_VLD)
return VLC_EGENERIC;
+#if !VLC_WINSTORE_APP
/* Allow using D3D11VA automatically starting from Windows 8.1 */
- if (!va->obj.force && !IsWindows8Point1OrGreater())
- return VLC_EGENERIC;
+ if (!va->obj.force)
+ {
+ bool isWin81OrGreater = false;
+ HMODULE hKernel32 = GetModuleHandle(TEXT("kernel32.dll"));
+ if (likely(hKernel32 != NULL))
+ isWin81OrGreater = GetProcAddress(hKernel32, "IsProcessCritical") != NULL;
+ if (!isWin81OrGreater)
+ return VLC_EGENERIC;
+ }
+#endif
vlc_va_sys_t *sys = calloc(1, sizeof (*sys));
if (unlikely(sys == NULL))
More information about the vlc-commits
mailing list