git: fd826f45f62e - main - multimedia/x264: Fix detection of cpu cores

Daniel Engberg <[email protected]>
Newsgroups gmane.os.freebsd.devel.cvs.ports
Message-ID <6a7f7eeb.3e14e.4607062a__14763.3541420632$1786740494$gmane$org@gitrepo.freebsd.org>
The branch main has been updated by diizzy:

URL: https://cgit.FreeBSD.org/ports/commit/?id=fd826f45f62edfb5b3886ab3635b3b2443831233

commit fd826f45f62edfb5b3886ab3635b3b2443831233
Author:     Daniel Engberg <[email protected]>
AuthorDate: 2026-08-14 19:39:28 +0000
Commit:     Daniel Engberg <[email protected]>
CommitDate: 2026-08-14 20:47:33 +0000

    multimedia/x264: Fix detection of cpu cores
    
    Partially revert changes in upstream commit
    da14df5535fd46776fb1c9da3130973295c87aca
    
    References:
    https://code.videolan.org/videolan/x264/-/commit/da14df5535fd46776fb1c9da3130973295c87aca
---
 multimedia/x264/Makefile                 |  1 +
 multimedia/x264/files/patch-common_cpu.c | 15 +++++++++++++++
 2 files changed, 16 insertions(+)

diff --git a/multimedia/x264/Makefile b/multimedia/x264/Makefile
index 1cd1e1c91140..9f8a276701dc 100644
--- a/multimedia/x264/Makefile
+++ b/multimedia/x264/Makefile
@@ -1,5 +1,6 @@
 PORTNAME=	x264
 DISTVERSION=	0.165.3223
+PORTREVISION=	1
 CATEGORIES=	multimedia
 
 MAINTAINER=	[email protected]
diff --git a/multimedia/x264/files/patch-common_cpu.c b/multimedia/x264/files/patch-common_cpu.c
new file mode 100644
index 000000000000..231c7d79c9ae
--- /dev/null
+++ b/multimedia/x264/files/patch-common_cpu.c
@@ -0,0 +1,15 @@
+--- common/cpu.c.orig	2026-08-13 20:46:48 UTC
++++ common/cpu.c
+@@ -658,10 +658,10 @@ int x264_cpu_num_processors( void )
+     get_system_info( &info );
+     return info.cpu_count;
+ 
+-#elif SYS_MACOSX
++#elif SYS_MACOSX || SYS_FREEBSD
+     int ncpu;
+     size_t length = sizeof( ncpu );
+-    if( sysctlbyname("hw.logicalcpu", &ncpu, &length, NULL, 0) )
++    if( sysctlbyname("hw.ncpu", &ncpu, &length, NULL, 0) )
+     {
+         ncpu = 1;
+     }
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.