Skip to content

Commit

Permalink
Fix nvidia vulkan decoding segmentation fault
Browse files Browse the repository at this point in the history
Original patch for fixing nvidia vulkan decoding:
streetpea/chiaki-ng#239 (comment)

References
----------
[1] https://trac.ffmpeg.org/ticket/10847
[2] https://trac.ffmpeg.org/ticket/10970
  • Loading branch information
dbermond committed May 1, 2024
1 parent 055dd84 commit 96716c2
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 5 deletions.
6 changes: 4 additions & 2 deletions .SRCINFO
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
pkgbase = ffmpeg-full-git
pkgdesc = Complete solution to record, convert and stream audio and video (all possible features including libfdk-aac; git version)
pkgver = 6.2.r114669.g240fd04db2
pkgver = 7.1.r115041.ge757726e89
pkgrel = 1
url = https://www.ffmpeg.org/
arch = x86_64
Expand Down Expand Up @@ -150,14 +150,16 @@ pkgbase = ffmpeg-full-git
source = 020-ffmpeg-add-svt-hevc-docs-ged80959.patch::https://github.com/raw/OpenVisualCloud/SVT-HEVC/ed80959ebb5586aa7763c91a397d44be1798587c/ffmpeg_plugin/0002-doc-Add-libsvt_hevc-encoder-docs.patch
source = 030-ffmpeg-add-svt-vp9-g3b9a3fa.patch::https://github.com/raw/OpenVisualCloud/SVT-VP9/3b9a3fa43da4cc5fe60c7d22afe2be15341392ea/ffmpeg_plugin/master-0001-Add-ability-for-ffmpeg-to-run-svt-vp9.patch
source = 040-ffmpeg-add-av_stream_get_first_dts-for-chromium.patch
source = 060-ffmpeg-fix-segfault-with-avisynthplus.patch
source = 050-ffmpeg-fix-segfault-with-avisynthplus.patch
source = 060-ffmpeg-fix-nvidia-vulkan-decoding-segfault.patch
source = LICENSE
sha256sums = SKIP
sha256sums = 9047e18d34716812d4ea7eafc1d0fd8b376d922a4b6b4dc20237662fcaf0c996
sha256sums = a164ebdc4d281352bf7ad1b179aae4aeb33f1191c444bed96cb8ab333c046f81
sha256sums = 59da61f2b2c556fbe0cdbf84bcc00977ee3d2447085decb21f6298226559f2aa
sha256sums = b54b47f4f3837ddc41227bd2202ea3c62e2ddb06c6cfbd7a9adc304d641d79ba
sha256sums = 0e277c0d5e33612ca7a11025958133b17bfbe23168b0aee5bd07f674f6fd7440
sha256sums = f2f73793a45c9dffb033f23c1b10a612abe6528cbd06c04b06e8189d1ef208be
sha256sums = 04a7176400907fd7db0d69116b99de49e582a6e176b3bfb36a03e50a4cb26a36

pkgname = ffmpeg-full-git
12 changes: 12 additions & 0 deletions 060-ffmpeg-fix-nvidia-vulkan-decoding-segfault.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
--- a/libavutil/vulkan.c
+++ b/libavutil/vulkan.c
@@ -607,6 +607,9 @@ int ff_vk_exec_add_dep_frame(FFVulkanContext *s, FFVkExecContext *e, AVFrame *f,
uint32_t *queue_family_dst;
VkAccessFlagBits *access_dst;

+ if (!f || !f->hw_frames_ctx)
+ return 1;
+
AVHWFramesContext *hwfc = (AVHWFramesContext *)f->hw_frames_ctx->data;
AVVulkanFramesContext *vkfc = hwfc->hwctx;
AVVkFrame *vkf = (AVVkFrame *)f->data[0];
9 changes: 6 additions & 3 deletions PKGBUILD
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Maintainer: Daniel Bermond <dbermond@archlinux.org>

pkgname=ffmpeg-full-git
pkgver=6.2.r114669.g240fd04db2
pkgver=7.1.r115041.ge757726e89
pkgrel=1
_svt_hevc_ver='ed80959ebb5586aa7763c91a397d44be1798587c'
_svt_vp9_ver='3b9a3fa43da4cc5fe60c7d22afe2be15341392ea'
Expand Down Expand Up @@ -144,14 +144,16 @@ source=('git+https://git.ffmpeg.org/ffmpeg.git'
"020-ffmpeg-add-svt-hevc-docs-g${_svt_hevc_ver:0:7}.patch"::"https://github.com/raw/OpenVisualCloud/SVT-HEVC/${_svt_hevc_ver}/ffmpeg_plugin/0002-doc-Add-libsvt_hevc-encoder-docs.patch"
"030-ffmpeg-add-svt-vp9-g${_svt_vp9_ver:0:7}.patch"::"https://github.com/raw/OpenVisualCloud/SVT-VP9/${_svt_vp9_ver}/ffmpeg_plugin/master-0001-Add-ability-for-ffmpeg-to-run-svt-vp9.patch"
'040-ffmpeg-add-av_stream_get_first_dts-for-chromium.patch'
'060-ffmpeg-fix-segfault-with-avisynthplus.patch'
'050-ffmpeg-fix-segfault-with-avisynthplus.patch'
'060-ffmpeg-fix-nvidia-vulkan-decoding-segfault.patch'
'LICENSE')
sha256sums=('SKIP'
'9047e18d34716812d4ea7eafc1d0fd8b376d922a4b6b4dc20237662fcaf0c996'
'a164ebdc4d281352bf7ad1b179aae4aeb33f1191c444bed96cb8ab333c046f81'
'59da61f2b2c556fbe0cdbf84bcc00977ee3d2447085decb21f6298226559f2aa'
'b54b47f4f3837ddc41227bd2202ea3c62e2ddb06c6cfbd7a9adc304d641d79ba'
'0e277c0d5e33612ca7a11025958133b17bfbe23168b0aee5bd07f674f6fd7440'
'f2f73793a45c9dffb033f23c1b10a612abe6528cbd06c04b06e8189d1ef208be'
'04a7176400907fd7db0d69116b99de49e582a6e176b3bfb36a03e50a4cb26a36')

prepare() {
Expand All @@ -166,7 +168,8 @@ prepare() {
patch -d ffmpeg -Np1 -i "${srcdir}/020-ffmpeg-add-svt-hevc-docs-g${_svt_hevc_ver:0:7}.patch"
patch -d ffmpeg -Np1 -i "${srcdir}/030-ffmpeg-add-svt-vp9-g${_svt_vp9_ver:0:7}.patch"
patch -d ffmpeg -Np1 -i "${srcdir}/040-ffmpeg-add-av_stream_get_first_dts-for-chromium.patch"
patch -d ffmpeg -Np1 -i "${srcdir}/060-ffmpeg-fix-segfault-with-avisynthplus.patch"
patch -d ffmpeg -Np1 -i "${srcdir}/050-ffmpeg-fix-segfault-with-avisynthplus.patch"
patch -d ffmpeg -Np1 -i "${srcdir}/060-ffmpeg-fix-nvidia-vulkan-decoding-segfault.patch"
}

pkgver() {
Expand Down

0 comments on commit 96716c2

Please sign in to comment.