Skip to content

Commit ff30846

Browse files
committed
avcodec/cuvid: make capability check optional
1 parent f890a6d commit ff30846

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

libavcodec/cuvid.c

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -707,6 +707,21 @@ static int cuvid_test_capabilities(AVCodecContext *avctx,
707707
CUVIDDECODECAPS *caps;
708708
int res8 = 0, res10 = 0, res12 = 0;
709709

710+
if (!ctx->cvdl->cuvidGetDecoderCaps) {
711+
av_log(avctx, AV_LOG_WARNING, "Used Nvidia driver is too old to perform a capability check.\n");
712+
av_log(avctx, AV_LOG_WARNING, "The minimum required version is "
713+
#if defined(_WIN32) || defined(__CYGWIN__)
714+
"378.66"
715+
#else
716+
"378.13"
717+
#endif
718+
". Continuing blind.\n");
719+
ctx->caps8.bIsSupported = ctx->caps10.bIsSupported = 1;
720+
// 12 bit was not supported before the capability check was introduced, so disable it.
721+
ctx->caps12.bIsSupported = 0;
722+
return 0;
723+
}
724+
710725
ctx->caps8.eCodecType = ctx->caps10.eCodecType = ctx->caps12.eCodecType
711726
= cuparseinfo->CodecType;
712727
ctx->caps8.eChromaFormat = ctx->caps10.eChromaFormat = ctx->caps12.eChromaFormat

0 commit comments

Comments
 (0)