commit 199a0b9715c000f33a2e0f90d55902341bef74fd
Author: Leigh Scott <leigh123linux(a)gmail.com>
Date: Mon Sep 30 19:59:24 2024 +0100
Rebuild for x265
HandBrake-x265-v4.patch | 70 +++++++++++++++++++++++++++++++++++++++++++++++++
HandBrake.spec | 10 ++++++-
2 files changed, 79 insertions(+), 1 deletion(-)
---
diff --git a/HandBrake-x265-v4.patch b/HandBrake-x265-v4.patch
new file mode 100644
index 0000000..1c1bcdb
--- /dev/null
+++ b/HandBrake-x265-v4.patch
@@ -0,0 +1,70 @@
+diff --git a/libhb/encx265.c b/libhb/encx265.c
+index fae6f22b4269..11c3976d5ff2 100644
+--- a/libhb/encx265.c
++++ b/libhb/encx265.c
+@@ -687,11 +687,20 @@ static hb_buffer_t* x265_encode(hb_work_object_t *w, hb_buffer_t
*in)
+ {
+ hb_work_private_t *pv = w->private_data;
+ hb_job_t *job = pv->job;
+- x265_picture pic_in, pic_out;
++
++ x265_picture pic_in;
++ x265_picture pic_layers_out[MAX_SCALABLE_LAYERS];
++ x265_picture *pic_lyrptr_out[MAX_SCALABLE_LAYERS];
++
+ x265_nal *nal;
+ uint32_t nnal;
+ int ret;
+
++ for (int i = 0; i < MAX_SCALABLE_LAYERS; i++)
++ {
++ pic_lyrptr_out[i] = &pic_layers_out[i];
++ }
++
+ pv->api->picture_init(pv->param, &pic_in);
+
+ pic_in.stride[0] = in->plane[0].stride;
+@@ -777,7 +786,7 @@ static hb_buffer_t* x265_encode(hb_work_object_t *w, hb_buffer_t
*in)
+ pv->last_stop = in->s.stop;
+ save_frame_info(pv, in);
+
+- ret = pv->api->encoder_encode(pv->x265, &nal, &nnal, &pic_in,
&pic_out);
++ ret = pv->api->encoder_encode(pv->x265, &nal, &nnal, &pic_in,
pic_lyrptr_out);
+
+ for (int i = 0; i < sei->numPayloads; i++)
+ {
+@@ -787,7 +796,7 @@ static hb_buffer_t* x265_encode(hb_work_object_t *w, hb_buffer_t
*in)
+
+ if (ret > 0)
+ {
+- return nal_encode(w, &pic_out, nal, nnal);
++ return nal_encode(w, pic_lyrptr_out[0], nal, nnal);
+ }
+ return NULL;
+ }
+@@ -801,16 +810,22 @@ int encx265Work(hb_work_object_t *w, hb_buffer_t **buf_in,
hb_buffer_t **buf_out
+ {
+ uint32_t nnal;
+ x265_nal *nal;
+- x265_picture pic_out;
++ x265_picture pic_layers_out[MAX_SCALABLE_LAYERS];
++ x265_picture *pic_lyrptr_out[MAX_SCALABLE_LAYERS];
+ hb_buffer_list_t list;
+
+ hb_buffer_list_clear(&list);
+
++ for (int i = 0; i < MAX_SCALABLE_LAYERS; i++)
++ {
++ pic_lyrptr_out[i] = &pic_layers_out[i];
++ }
++
+ // flush delayed frames
+ while (pv->api->encoder_encode(pv->x265, &nal,
+- &nnal, NULL, &pic_out) > 0)
++ &nnal, NULL, pic_lyrptr_out) > 0)
+ {
+- hb_buffer_t *buf = nal_encode(w, &pic_out, nal, nnal);
++ hb_buffer_t *buf = nal_encode(w, pic_lyrptr_out[0], nal, nnal);
+ hb_buffer_list_append(&list, buf);
+ }
+ // add the EOF to the end of the chain
diff --git a/HandBrake.spec b/HandBrake.spec
index 7b6ab5d..43ce317 100644
--- a/HandBrake.spec
+++ b/HandBrake.spec
@@ -12,7 +12,7 @@
Name: HandBrake
Version: 1.8.2
-Release: 1%{!?tag:.%{date}git%{shortcommit}}%{?dist}
+Release: 2%{!?tag:.%{date}git%{shortcommit}}%{?dist}
Summary: An open-source multiplatform video transcoder
License: GPLv2+
URL:
https://handbrake.fr/
@@ -40,6 +40,8 @@ Patch4: %{name}-syslibs-link.patch
Patch5: %{name}-no-contribs.patch
#
https://salsa.debian.org/multimedia-team/handbrake/-/raw/master/debian/pa...
Patch6: %{name}-remove-ambient-viewing-support.patch
+#
https://github.com/HandBrake/HandBrake/commit/65ec04667e69918401a0af77948...
+Patch7: %{name}-x265-v4.patch
BuildRequires: cmake
BuildRequires: desktop-file-utils
@@ -125,6 +127,9 @@ gpgv2 --keyring %{S:2} %{S:1} %{S:0}
%patch -P4 -p1
%patch -P5 -p1
%patch -P6 -p1
+%if 0%{?fedora} > 41
+%patch -P7 -p1
+%endif
# Use system libraries in place of bundled ones
for module in fdk-aac ffmpeg libdvdnav libdvdread libbluray %{?_with_vpl:libvpl} nvdec
nvenc svt-av1 x265; do
@@ -191,6 +196,9 @@ appstream-util validate-relax --nonet
%{buildroot}%{_metainfodir}/%{desktop_id}.
%{_bindir}/HandBrakeCLI
%changelog
+* Mon Sep 30 2024 Leigh Scott <leigh123linux(a)gmail.com> - 1.8.2-2
+- Rebuild for x265
+
* Sun Aug 18 2024 Dominik 'Rathann' Mierzejewski <dominik(a)greysector.net> -
1.8.2-1
- Update to 1.8.2