From 86c153d82919c4ecee15f3f5b976c4732ad24252 Mon Sep 17 00:00:00 2001 From: Kevin Mihelich Date: Sat, 22 Jun 2024 01:19:17 +0000 Subject: [PATCH] extra/ffmpeg: fixes --- extra/ffmpeg/0001-ffmpeg-wint.patch.patch | 25 +++++++++++++++++++++++ extra/ffmpeg/PKGBUILD | 12 ++++++++--- extra/ffmpeg/ffmpeg-6.1-gcc-14.patch | 13 ++++++++++++ 3 files changed, 47 insertions(+), 3 deletions(-) create mode 100644 extra/ffmpeg/0001-ffmpeg-wint.patch.patch create mode 100644 extra/ffmpeg/ffmpeg-6.1-gcc-14.patch diff --git a/extra/ffmpeg/0001-ffmpeg-wint.patch.patch b/extra/ffmpeg/0001-ffmpeg-wint.patch.patch new file mode 100644 index 000000000..3fbefe1b5 --- /dev/null +++ b/extra/ffmpeg/0001-ffmpeg-wint.patch.patch @@ -0,0 +1,25 @@ +From 1e1f10b8b95dcbc6521c391d4e9d4cb62943899f Mon Sep 17 00:00:00 2001 +From: Kevin Mihelich +Date: Fri, 21 Jun 2024 19:05:03 -0600 +Subject: [PATCH] ffmpeg-wint.patch + +--- + fftools/ffplay_renderer.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/fftools/ffplay_renderer.c b/fftools/ffplay_renderer.c +index 73072a2851..fbb68b2376 100644 +--- a/fftools/ffplay_renderer.c ++++ b/fftools/ffplay_renderer.c +@@ -765,7 +765,7 @@ static void destroy(VkRenderer *renderer) + vkDestroySurfaceKHR = (PFN_vkDestroySurfaceKHR) + ctx->get_proc_addr(ctx->inst, "vkDestroySurfaceKHR"); + vkDestroySurfaceKHR(ctx->inst, ctx->vk_surface, NULL); +- ctx->vk_surface = NULL; ++ ctx->vk_surface = VK_NULL_HANDLE; + } + + av_buffer_unref(&ctx->hw_device_ref); +-- +2.37.3 + diff --git a/extra/ffmpeg/PKGBUILD b/extra/ffmpeg/PKGBUILD index bc7f08758..fa95ad495 100644 --- a/extra/ffmpeg/PKGBUILD +++ b/extra/ffmpeg/PKGBUILD @@ -5,7 +5,6 @@ # Contributor: Paul Mattal # ALARM: Kevin Mihelich -# - use -fPIC in host cflags for v7/v8 to fix print_options.c compile # - remove makedepends on ffnvcodec-headers, remove --enable-nvenc, --enable-nvdec # - remove depends on aom, remove --enable-libaom # - remove optdepends on intel-media-sdk, onevpl-intel-gpu @@ -14,6 +13,8 @@ # - remove depends on rav1e, remove --enable-librav1e # - remove depends on svt-av1, remove --enable-libsvtav1 # - remove --enable-lto +# - patch from gentoo to fix 32-bit FTBFS +# - patch to fix 32-bit FTBFS pkgname=ffmpeg pkgver=7.0.1 @@ -122,14 +123,20 @@ _tag=47f70eda3e2ff003a787e512afd07b0c266f7a70 source=( git+https://git.ffmpeg.org/ffmpeg.git?signed#tag=${_tag} add-av_stream_get_first_dts-for-chromium.patch + ffmpeg-6.1-gcc-14.patch + 0001-ffmpeg-wint.patch.patch ) b2sums=('d2d6a645509e697932dc8f7a57719e069299e53eb37cda7bf01fd94c9e9956e5532dc5c923fa86d72d0e3a051a7f405e768c73c66ca8aea29271923a17222e03' - '555274228e09a233d92beb365d413ff5c718a782008075552cafb2130a3783cf976b51dfe4513c15777fb6e8397a34122d475080f2c4483e8feea5c0d878e6de') + '555274228e09a233d92beb365d413ff5c718a782008075552cafb2130a3783cf976b51dfe4513c15777fb6e8397a34122d475080f2c4483e8feea5c0d878e6de' + 'b82fc06a7eee0c7ab68ef78f3ac205f45a68a7799dc241f0a574afa48e4dbd477c0d67f7c5a7ff46971adc821ef1507f4957156200167a2c59f8c7f7867ac048' + '7855c938a9462bb2224236f779bb8863277551375253d6a67ec5feac047f0460d9fd571b37ebc3e8dab79471ee58b3bd2003e7e3b79c060738fb3ce49ebb0f61') validpgpkeys=(DD1EC9E8DE085C629B3E1846B18E8928B3948D64) # Michael Niedermayer prepare() { cd ffmpeg patch -Np1 -i ../add-av_stream_get_first_dts-for-chromium.patch # https://crbug.com/1251779 + patch -Np1 -i ../ffmpeg-6.1-gcc-14.patch + patch -Np1 -i ../0001-ffmpeg-wint.patch.patch } pkgver() { @@ -140,7 +147,6 @@ pkgver() { build() { export PKG_CONFIG_PATH='/usr/lib/mbedtls2/pkgconfig' cd ffmpeg - [[ $CARCH == "armv7h" || $CARCH == "aarch64" ]] && CONFIG='--host-cflags="-fPIC"' ./configure \ --prefix=/usr \ diff --git a/extra/ffmpeg/ffmpeg-6.1-gcc-14.patch b/extra/ffmpeg/ffmpeg-6.1-gcc-14.patch new file mode 100644 index 000000000..0db7301f1 --- /dev/null +++ b/extra/ffmpeg/ffmpeg-6.1-gcc-14.patch @@ -0,0 +1,13 @@ +diff --git a/libavutil/hwcontext_vaapi.c b/libavutil/hwcontext_vaapi.c +index 29fc8bd648..1f85fac7f4 100644 +--- a/libavutil/hwcontext_vaapi.c ++++ b/libavutil/hwcontext_vaapi.c +@@ -1203,7 +1203,7 @@ static int vaapi_map_from_drm(AVHWFramesContext *src_fc, AVFrame *dst, + + if (!use_prime2 || vas != VA_STATUS_SUCCESS) { + int k; +- unsigned long buffer_handle; ++ uintptr_t buffer_handle; + VASurfaceAttribExternalBuffers buffer_desc; + VASurfaceAttrib buffer_attrs[2] = { + {