diff options
author | Jacob Trimble <modmaker-at-google.com@ffmpeg.org> | 2017-11-30 12:35:50 -0800 |
---|---|---|
committer | Timo Rothenpieler <timo@rothenpieler.org> | 2017-12-08 17:56:38 +0100 |
commit | 2fdc9f7c4939f83a6c9d1f9d85b6d37ce0bab714 (patch) | |
tree | ae86015d16e2f3fd14f86a862168d61c5af0b5e2 | |
parent | bc38c8f4424982617a92d1cefa7fdcb640a80234 (diff) | |
download | ffmpeg-2fdc9f7c4939f83a6c9d1f9d85b6d37ce0bab714.tar.gz |
avcodec/nvdec: Fix capability check with old drivers.
Copied the check from cuviddec.c (*_cuvid decoders) to allow the
capability check to be optional for older drivers.
Signed-off-by: Jacob Trimble <modmaker@google.com>
Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
-rw-r--r-- | libavcodec/nvdec.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/libavcodec/nvdec.c b/libavcodec/nvdec.c index c7a02ff40f..e9e6ea0f8b 100644 --- a/libavcodec/nvdec.c +++ b/libavcodec/nvdec.c @@ -91,6 +91,18 @@ static int nvdec_test_capabilities(NVDECDecoder *decoder, caps.eChromaFormat = params->ChromaFormat; caps.nBitDepthMinus8 = params->bitDepthMinus8; + if (!decoder->cvdl->cuvidGetDecoderCaps) { + av_log(logctx, AV_LOG_WARNING, "Used Nvidia driver is too old to perform a capability check.\n"); + av_log(logctx, AV_LOG_WARNING, "The minimum required version is " +#if defined(_WIN32) || defined(__CYGWIN__) + "378.66" +#else + "378.13" +#endif + ". Continuing blind.\n"); + return 0; + } + err = decoder->cvdl->cuvidGetDecoderCaps(&caps); if (err != CUDA_SUCCESS) { av_log(logctx, AV_LOG_ERROR, "Failed querying decoder capabilities\n"); |