From 9f3902f107343f2690dce7ac7fef7c66887692b1 Mon Sep 17 00:00:00 2001 From: Timo Rothenpieler Date: Fri, 13 Apr 2018 09:36:49 +0200 Subject: avcodec/nv{enc,dec}: use sane version checking macro For some odd reason, the Nvidia version macros puts the minor version in the msb, so comparing against it is impossible. --- libavcodec/nvenc.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'libavcodec/nvenc.h') diff --git a/libavcodec/nvenc.h b/libavcodec/nvenc.h index 2d6e781739..c7506d6a15 100644 --- a/libavcodec/nvenc.h +++ b/libavcodec/nvenc.h @@ -40,8 +40,11 @@ typedef void ID3D11Device; #define RC_MODE_DEPRECATED 0x800000 #define RCD(rc_mode) ((rc_mode) | RC_MODE_DEPRECATED) +#define NVENCAPI_CHECK_VERSION(major, minor) \ + ((major) < NVENCAPI_MAJOR_VERSION || ((major) == NVENCAPI_MAJOR_VERSION && (minor) <= NVENCAPI_MINOR_VERSION)) + // SDK 8.1 compile time feature checks -#if NVENCAPI_VERSION >= 0x01000008 +#if NVENCAPI_CHECK_VERSION(8, 1) #define NVENC_HAVE_BFRAME_REF_MODE #define NVENC_HAVE_QP_MAP_MODE #endif -- cgit v1.2.3