commit 86949ed2915cac00a49bff9e597b4037b3ee9d66
Author: Leigh Scott <leigh123linux(a)gmail.com>
Date: Mon Sep 30 16:08:25 2024 +0100
Add build fix for new x265
buildfix_x265.patch | 78 +++++++++++++++++++++++++++++++++++++++++++++++++++++
ffmpeg.spec | 7 ++++-
2 files changed, 84 insertions(+), 1 deletion(-)
---
diff --git a/buildfix_x265.patch b/buildfix_x265.patch
new file mode 100644
index 0000000..f671e02
--- /dev/null
+++ b/buildfix_x265.patch
@@ -0,0 +1,78 @@
+diff -uNrp a/libavcodec/libx265.c b/libavcodec/libx265.c
+--- a/libavcodec/libx265.c 2024-08-02 00:22:48.000000000 +0100
++++ b/libavcodec/libx265.c 2024-09-30 15:41:46.083523907 +0100
+@@ -581,7 +581,13 @@ static int libx265_encode_frame(AVCodecC
+ {
+ libx265Context *ctx = avctx->priv_data;
+ x265_picture x265pic;
+- x265_picture x265pic_out = { 0 };
++#if X265_BUILD >= 210
++ x265_picture x265pic_layers_out[MAX_SCALABLE_LAYERS];
++ x265_picture* x265pic_lyrptr_out[MAX_SCALABLE_LAYERS];
++#else
++ x265_picture x265pic_solo_out = { 0 };
++#endif
++ x265_picture* x265pic_out;
+ x265_nal *nal;
+ x265_sei *sei;
+ uint8_t *dst;
+@@ -704,8 +710,16 @@ FF_ENABLE_DEPRECATION_WARNINGS
+ }
+ }
+
++#if X265_BUILD >= 210
++ for (i = 0; i < MAX_SCALABLE_LAYERS; i++)
++ x265pic_lyrptr_out[i] = &x265pic_layers_out[i];
++
++ ret = ctx->api->encoder_encode(ctx->encoder, &nal, &nnal,
++ pic ? &x265pic : NULL, x265pic_lyrptr_out);
++#else
+ ret = ctx->api->encoder_encode(ctx->encoder, &nal, &nnal,
+- pic ? &x265pic : NULL, &x265pic_out);
++ pic ? &x265pic : NULL, &x265pic_solo_out);
++#endif
+
+ for (i = 0; i < sei->numPayloads; i++)
+ av_free(sei->payloads[i].payload);
+@@ -735,10 +749,16 @@ FF_ENABLE_DEPRECATION_WARNINGS
+ pkt->flags |= AV_PKT_FLAG_KEY;
+ }
+
+- pkt->pts = x265pic_out.pts;
+- pkt->dts = x265pic_out.dts;
++#if X265_BUILD >= 210
++ x265pic_out = x265pic_lyrptr_out[0];
++#else
++ x265pic_out = &x265pic_solo_out;
++#endif
++
++ pkt->pts = x265pic_out->pts;
++ pkt->dts = x265pic_out->dts;
+
+- switch (x265pic_out.sliceType) {
++ switch (x265pic_out->sliceType) {
+ case X265_TYPE_IDR:
+ case X265_TYPE_I:
+ pict_type = AV_PICTURE_TYPE_I;
+@@ -756,16 +776,16 @@ FF_ENABLE_DEPRECATION_WARNINGS
+ }
+
+ #if X265_BUILD >= 130
+- if (x265pic_out.sliceType == X265_TYPE_B)
++ if (x265pic_out->sliceType == X265_TYPE_B)
+ #else
+- if (x265pic_out.frameData.sliceType == 'b')
++ if (x265pic_out->frameData.sliceType == 'b')
+ #endif
+ pkt->flags |= AV_PKT_FLAG_DISPOSABLE;
+
+- ff_side_data_set_encoder_stats(pkt, x265pic_out.frameData.qp * FF_QP2LAMBDA, NULL,
0, pict_type);
++ ff_side_data_set_encoder_stats(pkt, x265pic_out->frameData.qp * FF_QP2LAMBDA,
NULL, 0, pict_type);
+
+- if (x265pic_out.userData) {
+- int idx = (int)(intptr_t)x265pic_out.userData - 1;
++ if (x265pic_out->userData) {
++ int idx = (int)(intptr_t)x265pic_out->userData - 1;
+ ReorderedData *rd = &ctx->rd[idx];
+
+ #if FF_API_REORDERED_OPAQUE
diff --git a/ffmpeg.spec b/ffmpeg.spec
index 989b2ae..00ad2c9 100644
--- a/ffmpeg.spec
+++ b/ffmpeg.spec
@@ -98,7 +98,7 @@ ExclusiveArch: armv7hnl
Summary: Digital VCR and streaming server
Name: ffmpeg%{?flavor}
Version: 6.1.2
-Release: 2%{?dist}
+Release: 3%{?dist}
License: %{ffmpeg_license}
URL:
https://ffmpeg.org/
%if 0%{?date}
@@ -113,6 +113,8 @@ Patch0: ffmpeg-chromium.patch
Patch1:
https://src.fedoraproject.org/rpms/ffmpeg/raw/774d42a0072430fdef97ce11b40...
Patch2:
https://git.ffmpeg.org/gitweb/ffmpeg.git/commitdiff_plain/42982b5a5d46153...
Patch3:
https://git.ffmpeg.org/gitweb/ffmpeg.git/commitdiff_plain/d9f1b321cf58a85...
+#
https://github.com/FFmpeg/FFmpeg/commit/1f801dfdb5066aadf0ade9cb5e94d620f...
+Patch4: buildfix_x265.patch
Conflicts: %{name}-free
Provides: %{name}-bin = %{version}-%{release}
Requires: %{name}-libs%{?_isa} = %{version}-%{release}
@@ -531,6 +533,9 @@ cp -pa %{buildroot}%{_libdir}/libavcodec.so.* \
%changelog
+* Mon Sep 30 2024 Leigh Scott <leigh123linux(a)gmail.com> - 6.1.2-3
+- Add build fix for new x265
+
* Fri Aug 16 2024 Leigh Scott <leigh123linux(a)gmail.com> - 6.1.2-2
- Backport hevecdec fix