Index | Thread | Search

From:
Kirill A. Korinsky <kirill@korins.ky>
Subject:
Re: UPDATE: HandBrake
To:
Brad Smith <brad@comstyle.com>, ports@openbsd.org
Date:
Wed, 04 Dec 2024 19:38:50 +0100

Download raw body.

Thread
On Wed, 04 Dec 2024 10:49:23 +0100,
Stuart Henderson <stu@spacehopper.org> wrote:
> 
> Something, probably the x265 update, broke HandBrake?
> 
> /pobj/handbrake-1.6.1/HandBrake-1.6.1/libhb/encx265.c:444:20: warning: comparison of array 'param->csvfn' equal to a n
> ull pointer is always false [-Wtautological-pointer-compare]
>         if (param->csvfn == NULL)
>             ~~~~~~~^~~~~    ~~~~
> /pobj/handbrake-1.6.1/HandBrake-1.6.1/libhb/encx265.c:447:26: error: array type 'char[256]' is not assignable
>             param->csvfn = strdup(pv->csvfn);
>             ~~~~~~~~~~~~ ^
> 1 warning and 1 error generated.
> 

My attempt to update it to 1.9.0 leads to an issues that x265 needs this
patches: https://github.com/HandBrake/HandBrake/tree/1.9.0/contrib/x265

After that, it needs this patches for our ffmpeg:
https://github.com/HandBrake/HandBrake/tree/1.9.0/contrib/ffmpeg

and so on, and so on.

At some point I had discovered that upstream made it clear that without
patching ffmpeg HandBrake is broken, see:
https://github.com/HandBrake/HandBrake/issues/6179

Can we updated HandBrake? Probably.

Can we fix the current version? Defently, here the diff.

Anyway, the diff :

Index: Makefile
===================================================================
RCS file: /home/cvs/ports/multimedia/handbrake/Makefile,v
diff -u -p -r1.25 Makefile
--- Makefile	24 Nov 2024 12:57:33 -0000	1.25
+++ Makefile	4 Dec 2024 18:22:40 -0000
@@ -3,7 +3,7 @@ COMMENT =	open source video transcoder
 V =		1.6.1
 DISTNAME =	HandBrake-${V}-source
 PKGNAME =	handbrake-${V}
-REVISION =	1
+REVISION =	2
 EXTRACT_SUFX =	.tar.bz2
 CATEGORIES =	multimedia x11
 
Index: patches/patch-libhb_encx265_c
===================================================================
RCS file: patches/patch-libhb_encx265_c
diff -N patches/patch-libhb_encx265_c
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ patches/patch-libhb_encx265_c	4 Dec 2024 18:17:36 -0000
@@ -0,0 +1,18 @@
+Backport relevant part of https://github.com/HandBrake/HandBrake/commit/3e6479d666f76a5956bb5ce9a5d85ee8c925bbd3
+
+Index: libhb/encx265.c
+--- libhb/encx265.c.orig
++++ libhb/encx265.c
+@@ -463,10 +463,10 @@ int encx265Init(hb_work_object_t *w, hb_job_t *job)
+     /* statsfile (but not 2-pass) */
+     if (param->logLevel >= X265_LOG_DEBUG)
+     {
+-        if (param->csvfn == NULL)
++        if (param->csvfn[0] == '\0')
+         {
+             pv->csvfn = hb_get_temporary_filename("x265.csv");
+-            param->csvfn = strdup(pv->csvfn);
++            snprintf(param->csvfn, X265_MAX_STRING_SIZE, "%s", pv->csvfn);
+         }
+         else
+         {

-- 
wbr, Kirill