[vlc-commits] d3d11va: don't use D3D11VA automatically on OSes older than Win8.1
Steve Lhomme
git at videolan.org
Tue Jul 31 15:38:01 CEST 2018
vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Tue Jul 31 15:37:34 2018 +0200| [2c2eeb8e5a19bbcd35d6cea02ea3dc52e480cc7a] | committer: Steve Lhomme
d3d11va: don't use D3D11VA automatically on OSes older than Win8.1
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=2c2eeb8e5a19bbcd35d6cea02ea3dc52e480cc7a
---
modules/codec/avcodec/d3d11va.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/modules/codec/avcodec/d3d11va.c b/modules/codec/avcodec/d3d11va.c
index 7244c29d88..bd202e4392 100644
--- a/modules/codec/avcodec/d3d11va.c
+++ b/modules/codec/avcodec/d3d11va.c
@@ -43,6 +43,8 @@
#include <vlc_charset.h>
#include <vlc_codec.h>
+#include <versionhelpers.h>
+
#define COBJMACROS
#include <initguid.h>
#include <d3d11.h>
@@ -319,6 +321,10 @@ static int Open(vlc_va_t *va, AVCodecContext *ctx, enum PixelFormat pix_fmt,
if (pix_fmt != AV_PIX_FMT_D3D11VA_VLD)
return VLC_EGENERIC;
+ /* Allow using D3D11VA automatically starting from Windows 8.1 */
+ if (!va->obj.force && !IsWindows8Point1OrGreater())
+ return VLC_EGENERIC;
+
vlc_va_sys_t *sys = calloc(1, sizeof (*sys));
if (unlikely(sys == NULL))
return VLC_ENOMEM;
More information about the vlc-commits
mailing list