commit 15dc5d91727f7891af67b23f200db7db92a02d0f
Author: Nicolas Chauvet <kwizart(a)gmail.com>
Date: Sat Apr 6 12:23:21 2019 +0200
Backport for Enable HEVC support for working Nvidia driver versions
4a6d5f3cadaabefe6c3548e575bb7e713997762f.patch | 29 ++++++++++++++++++++++++++
4a976200d7853588336005a394dd31d905f5caf6.patch | 22 +++++++++++++++++++
ffmpeg.spec | 6 ++++++
3 files changed, 57 insertions(+)
---
diff --git a/4a6d5f3cadaabefe6c3548e575bb7e713997762f.patch
b/4a6d5f3cadaabefe6c3548e575bb7e713997762f.patch
new file mode 100644
index 0000000..0d2e2ba
--- /dev/null
+++ b/4a6d5f3cadaabefe6c3548e575bb7e713997762f.patch
@@ -0,0 +1,29 @@
+commit 4a6d5f3cadaabefe6c3548e575bb7e713997762f
+Author: ManojGuptaBonda <mbonda(a)nvidia.com>
+Date: Mon Oct 29 13:39:54 2018 +0530
+
+ avcodec/vdpau: Enable HEVC support for working Nvidia driver versions
+
+ The driver bugs that caused decoded HEVC content to have an incorrect
+ memory layout have been fully fixed in the 410.xx driver release so
+ we can start exposing support.
+
+diff --git a/libavcodec/vdpau.c b/libavcodec/vdpau.c
+index 1b2ec989cd..59454e8c4b 100644
+--- a/libavcodec/vdpau.c
++++ b/libavcodec/vdpau.c
+@@ -208,8 +208,12 @@ int ff_vdpau_common_init(AVCodecContext *avctx, VdpDecoderProfile
profile,
+ 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);
++ int driver_version;
++ sscanf(info_string, "NVIDIA VDPAU Driver Shared Library %d",
&driver_version);
++ if (driver_version < 410) {
++ 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,
diff --git a/4a976200d7853588336005a394dd31d905f5caf6.patch
b/4a976200d7853588336005a394dd31d905f5caf6.patch
new file mode 100644
index 0000000..b599d2f
--- /dev/null
+++ b/4a976200d7853588336005a394dd31d905f5caf6.patch
@@ -0,0 +1,22 @@
+commit 4a976200d7853588336005a394dd31d905f5caf6
+Author: Philip Langdale <philipl(a)overt.org>
+Date: Wed Oct 31 16:58:09 2018 -0700
+
+ avcodec/vdpau: Initialise driver version variable explicitly
+
+ If the identification string ever changed, we might not match anything
+ in the sscanf(). At least have predictable behaviour.
+
+diff --git a/libavcodec/vdpau.c b/libavcodec/vdpau.c
+index 59454e8c4b..167f06d7ae 100644
+--- a/libavcodec/vdpau.c
++++ b/libavcodec/vdpau.c
+@@ -208,7 +208,7 @@ int ff_vdpau_common_init(AVCodecContext *avctx, VdpDecoderProfile
profile,
+ 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)) {
+- int driver_version;
++ int driver_version = 0;
+ sscanf(info_string, "NVIDIA VDPAU Driver Shared Library %d",
&driver_version);
+ if (driver_version < 410) {
+ av_log(avctx, AV_LOG_VERBOSE, "HEVC with NVIDIA VDPAU drivers is buggy,
skipping.\n");
diff --git a/ffmpeg.spec b/ffmpeg.spec
index de38bb8..a8193f3 100644
--- a/ffmpeg.spec
+++ b/ffmpeg.spec
@@ -102,6 +102,10 @@ Patch0: 87cc7e8d4ef8fa643d8d4822525b9c95cc9e7307.patch
#Backport avutil/mem: Fix invalid use of av_alloc_size
#See rfbz#5221
Patch1: 4361293fcf59edb56879c36edcd25f0a91e0edf8.patch
+#Backport Enable HEVC support for working Nvidia driver versions
+Patch2: 4a6d5f3cadaabefe6c3548e575bb7e713997762f.patch
+Patch3: 4a976200d7853588336005a394dd31d905f5caf6.patch
+
Requires: %{name}-libs%{?_isa} = %{version}-%{release}
%{?_with_cuda:BuildRequires: cuda-minimal-build-%{_cuda_version_rpm} cuda-drivers-devel}
%{?_with_libnpp:BuildRequires: pkgconfig(nppc-%{_cuda_version})}
@@ -328,6 +332,8 @@ echo "git-snapshot-%{?branch}%{date}-rpmfusion" >
VERSION
%endif
%patch0 -p1 -b .vmaf_build
%patch1 -p1
+%patch2 -p1
+%patch3 -p1
# fix -O3 -g in host_cflags
sed -i "s|check_host_cflags -O3|check_host_cflags %{optflags}|" configure
Show replies by date