X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavcodec%2Fvdpau.c;h=42ebddbeeee2eee5fa4aad41a56dd1f7da67a49d;hb=5256a86da067a324ece20bb9584880f5a63744ce;hp=9c7804a2878a6bc4d45f64ab70890508d8f44e01;hpb=cea5e7355c58004605321295b7a506052292dbbc;p=ffmpeg diff --git a/libavcodec/vdpau.c b/libavcodec/vdpau.c index 9c7804a2878..42ebddbeeee 100644 --- a/libavcodec/vdpau.c +++ b/libavcodec/vdpau.c @@ -127,6 +127,8 @@ int ff_vdpau_common_init(AVCodecContext *avctx, VdpDecoderProfile profile, VdpVideoSurfaceQueryCapabilities *surface_query_caps; VdpDecoderQueryCapabilities *decoder_query_caps; VdpDecoderCreate *create; + VdpGetInformationString *info; + const char *info_string; void *func; VdpStatus status; VdpBool supported; @@ -208,6 +210,23 @@ int ff_vdpau_common_init(AVCodecContext *avctx, VdpDecoderProfile profile, if (level < 0) return AVERROR(ENOTSUP); + status = vdctx->get_proc_address(vdctx->device, + VDP_FUNC_ID_GET_INFORMATION_STRING, + &func); + if (status != VDP_STATUS_OK) + return vdpau_error(status); + else + info = func; + + status = info(&info_string); + if (status != VDP_STATUS_OK) + return vdpau_error(status); + if (avctx->codec_id == AV_CODEC_ID_HEVC && strncmp(info_string, "NVIDIA ", 7) == 0 && + !(avctx->hwaccel_flags & AV_HWACCEL_FLAG_ALLOW_PROFILE_MISMATCH)) { + av_log(avctx, AV_LOG_VERBOSE, "HEVC with NVIDIA VDPAU drivers is buggy, skipping.\n"); + return AVERROR(ENOTSUP); + } + status = vdctx->get_proc_address(vdctx->device, VDP_FUNC_ID_VIDEO_SURFACE_QUERY_CAPABILITIES, &func);