[vlc-commits] d3d11va: don't use D3D11VA automatically on OSes older than Win8.1

Steve Lhomme git at videolan.org
Tue Aug 7 09:13:05 CEST 2018


vlc/vlc-3.0 | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Tue Jul 31 15:37:34 2018 +0200| [f448a795cb7e4643e16b31ce7ec2e89753a701a0] | committer: Steve Lhomme

d3d11va: don't use D3D11VA automatically on OSes older than Win8.1

(cherry picked from commit 2c2eeb8e5a19bbcd35d6cea02ea3dc52e480cc7a)

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

 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 5e3b052196..f73f5dfce8 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>
@@ -318,6 +320,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