ffmpeg6: Add patch to enable pthread_setname_np.

This commit is contained in:
Augustin Cavalier
2025-02-21 14:14:55 -05:00
parent 053368db2f
commit 6121f3aa49
2 changed files with 30 additions and 1 deletions

View File

@@ -6,7 +6,7 @@ HOMEPAGE="https://ffmpeg.org/"
COPYRIGHT="2000-2003 Fabrice Bellard
2003-2024 the FFmpeg developers"
LICENSE="GNU LGPL v3"
REVISION="1"
REVISION="2"
SOURCE_URI="https://ffmpeg.org/releases/ffmpeg-$portVersion.tar.xz"
CHECKSUM_SHA256="3b624649725ecdc565c903ca6643d41f33bd49239922e45c9b1442c63dca4e38"
PATCHES="ffmpeg-$portVersion.patchset"

View File

@@ -0,0 +1,29 @@
From b6161b96772073dbe8fe2ecc73da45c42e389c35 Mon Sep 17 00:00:00 2001
From: Augustin Cavalier <waddlesplash@gmail.com>
Date: Fri, 21 Feb 2025 14:12:40 -0500
Subject: libavutil: Forcibly enable use of pthread_setname_np.
Defining _BSD_SOURCE in here may not work if pthread.h
was already included, so just redeclare the method and
set the definition.
diff --git a/libavutil/thread.h b/libavutil/thread.h
index 2c00c7c..98f6edb 100644
--- a/libavutil/thread.h
+++ b/libavutil/thread.h
@@ -37,6 +37,12 @@
#if HAVE_PTHREADS
#include <pthread.h>
+#ifdef __HAIKU__
+extern int pthread_setname_np(pthread_t thread, const char* name);
+#undef HAVE_PTHREAD_SETNAME_NP
+#define HAVE_PTHREAD_SETNAME_NP 1
+#endif
+
#if defined(ASSERT_LEVEL) && ASSERT_LEVEL > 1
#include <stdlib.h>
--
2.45.2