diff --git a/patches/99-ffmpeg/unbreak-build-with-latest-svtav1.patch b/patches/99-ffmpeg/unbreak-build-with-latest-svtav1.patch new file mode 100644 index 0000000..fb1a372 --- /dev/null +++ b/patches/99-ffmpeg/unbreak-build-with-latest-svtav1.patch @@ -0,0 +1,30 @@ +From d1ed5c06e3edc5f2b5f3664c80121fa55b0baa95 Mon Sep 17 00:00:00 2001 +From: Gyan Doshi +Date: Sat, 22 Feb 2025 10:38:53 +0530 +Subject: [PATCH] avcodec/libsvtav1: unbreak build with latest svtav1 + +SVT-AV1 made a change in their public API in 988e930c but without a +version bump or any other accessible marker, thus breaking ffmpeg build +with current versions of SVT-AV1. + +They have finally bumped versions a month later, so check added. +--- + libavcodec/libsvtav1.c | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/libavcodec/libsvtav1.c b/libavcodec/libsvtav1.c +index 79b28eb4df546..43fe531fde74d 100644 +--- a/libavcodec/libsvtav1.c ++++ b/libavcodec/libsvtav1.c +@@ -435,7 +435,11 @@ static av_cold int eb_enc_init(AVCodecContext *avctx) + + svt_enc->eos_flag = EOS_NOT_REACHED; + ++#if SVT_AV1_CHECK_VERSION(3, 0, 0) ++ svt_ret = svt_av1_enc_init_handle(&svt_enc->svt_handle, &svt_enc->enc_params); ++#else + svt_ret = svt_av1_enc_init_handle(&svt_enc->svt_handle, svt_enc, &svt_enc->enc_params); ++#endif + if (svt_ret != EB_ErrorNone) { + return svt_print_error(avctx, svt_ret, "Error initializing encoder handle"); + } diff --git a/stages/50-svt-av1.sh b/stages/50-svt-av1.sh index fbe4d17..e0736f8 100644 --- a/stages/50-svt-av1.sh +++ b/stages/50-svt-av1.sh @@ -4,7 +4,7 @@ echo "Download svt-av1..." mkdir -p svt-av1 # renovate: datasource=gitlab-releases depName=AOMediaCodec/SVT-AV1 -_tag='2.3.0' +_tag='3.0.0' curl_tar "https://gitlab.com/AOMediaCodec/SVT-AV1/-/archive/v${_tag}/SVT-AV1-v${_tag}.tar.gz" svt-av1 1 diff --git a/stages/99-ffmpeg.sh b/stages/99-ffmpeg.sh index b665f25..e38b6fd 100644 --- a/stages/99-ffmpeg.sh +++ b/stages/99-ffmpeg.sh @@ -31,6 +31,9 @@ for patch in \ curl "$patch" | patch -F5 -lp1 -d ffmpeg -t done +# Fix FFmpeg compilation with latest SVT-AV1 +patch -F5 -lp1 -d ffmpeg -t <"$PREFIX"/patches/unbreak-build-with-latest-svtav1.patch + if [ "$OS_IPHONE" -gt 0 ]; then # Patch to remove ffmpeg using non public API on iOS patch -F5 -lp1 -d ffmpeg -t <"$PREFIX"/patches/remove_lzma_apple_non_public_api.patch