diff options
author | Timo Rothenpieler <timo@rothenpieler.org> | 2018-04-13 10:36:49 +0300 |
---|---|---|
committer | Timo Rothenpieler <timo@rothenpieler.org> | 2018-04-13 12:19:43 +0300 |
commit | 9f3902f107343f2690dce7ac7fef7c66887692b1 (patch) | |
tree | bdca818f2528af84e0cb75911c2b811ae192544a /libavcodec/nvdec.h | |
parent | 987026adda79be4bbc541e12c5c6796b43f84bc1 (diff) |
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.
Diffstat (limited to 'libavcodec/nvdec.h')
-rw-r--r-- | libavcodec/nvdec.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/libavcodec/nvdec.h b/libavcodec/nvdec.h index 90578d5a1c..85a0fcf725 100644 --- a/libavcodec/nvdec.h +++ b/libavcodec/nvdec.h @@ -32,6 +32,15 @@ #include "avcodec.h" +#if defined(NVDECAPI_MAJOR_VERSION) && defined(NVDECAPI_MINOR_VERSION) +# define NVDECAPI_CHECK_VERSION(major, minor) \ + ((major) < NVDECAPI_MAJOR_VERSION || ((major) == NVDECAPI_MAJOR_VERSION && (minor) <= NVDECAPI_MINOR_VERSION)) +#else +/* version macros were added in SDK 8.1 ffnvcodec */ +# define NVDECAPI_CHECK_VERSION(major, minor) \ + ((major) < 8 || ((major) == 8 && (minor) <= 0)) +#endif + typedef struct NVDECFrame { unsigned int idx; AVBufferRef *idx_ref; |