From f52c5d3a5a99bff5572ede1c842dc5358af5abf5 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Felix=20Paul=20K=C3=BChne?= <felix@feepk.net>
Date: Tue, 28 Feb 2023 11:52:11 +0100
Subject: [PATCH] libvlc: update to current master

This also removes 3 patches that are no longer needed.
---
 compileAndBuildVLCKit.sh                      |   2 +-
 ...contrib-live555-update-to-2022.07.14.patch |   4 +-
 ...555-version-that-is-compatible-with-.patch |   4 +-
 ...se-the-full-module-name-as-MODULE_NA.patch |   4 +-
 ...in-auth-struct-for-the-runtime-of-th.patch |   8 +-
 ...file-Add-error-dialog-for-write-open.patch |   6 +-
 ...6-webservices-avoid-symbol-conflict.patch} |   4 +-
 ...rust-when-compiling-on-macOS-ARM-64.patch} |   6 +-
 ...xtras-disable-rav1e-for-iOS-and-tvOS.patch |  31 ---
 ...008-http-add-vlc_http_cookies_clear.patch} |   6 +-
 ...eg-use-audiotoolbox-on-iOS-for-AC-3.patch} |   4 +-
 ...010-libvlc_media-add-cookie_jar-API.patch} |  16 +-
 ...y-to-configure-an-http-access-token.patch} |   4 +-
 ...-retain-compilation-support-for-i386.patch |  47 -----
 ...ch => 0012-adaptive-NULL-http-token.patch} |   4 +-
 ...0013-http-initialize-token-properly.patch} |   4 +-
 ...x-cross-compilation-for-macOS-on-ma.patch} |   4 +-
 ...for-32bit-runtimes-without-thread_lo.patch | 189 ------------------
 18 files changed, 40 insertions(+), 307 deletions(-)
 rename libvlc/patches/{0008-webservices-avoid-symbol-conflict.patch => 0006-webservices-avoid-symbol-conflict.patch} (96%)
 rename libvlc/patches/{0009-contrib-disable-rust-when-compiling-on-macOS-ARM-64.patch => 0007-contrib-disable-rust-when-compiling-on-macOS-ARM-64.patch} (82%)
 delete mode 100644 libvlc/patches/0007-extras-disable-rav1e-for-iOS-and-tvOS.patch
 rename libvlc/patches/{0010-http-add-vlc_http_cookies_clear.patch => 0008-http-add-vlc_http_cookies_clear.patch} (92%)
 rename libvlc/patches/{0012-contrib-ffmpeg-use-audiotoolbox-on-iOS-for-AC-3.patch => 0009-contrib-ffmpeg-use-audiotoolbox-on-iOS-for-AC-3.patch} (95%)
 rename libvlc/patches/{0013-libvlc_media-add-cookie_jar-API.patch => 0010-libvlc_media-add-cookie_jar-API.patch} (98%)
 rename libvlc/patches/{0014-Add-property-to-configure-an-http-access-token.patch => 0011-Add-property-to-configure-an-http-access-token.patch} (95%)
 delete mode 100644 libvlc/patches/0011-src-add-hack-to-retain-compilation-support-for-i386.patch
 rename libvlc/patches/{0015-adaptive-NULL-http-token.patch => 0012-adaptive-NULL-http-token.patch} (90%)
 rename libvlc/patches/{0017-http-initialize-token-properly.patch => 0013-http-initialize-token-properly.patch} (87%)
 rename libvlc/patches/{0018-contrib-ffmpeg-fix-cross-compilation-for-macOS-on-ma.patch => 0014-contrib-ffmpeg-fix-cross-compilation-for-macOS-on-ma.patch} (83%)
 delete mode 100644 libvlc/patches/0016-Fix-compilation-for-32bit-runtimes-without-thread_lo.patch

diff --git a/compileAndBuildVLCKit.sh b/compileAndBuildVLCKit.sh
index b0283cdf..96fe8cfc 100755
--- a/compileAndBuildVLCKit.sh
+++ b/compileAndBuildVLCKit.sh
@@ -28,7 +28,7 @@ if [ -z "$MAKEFLAGS" ]; then
     MAKEFLAGS="-j$(sysctl -n machdep.cpu.core_count || nproc)";
 fi
 
-TESTEDHASH="d4f5bd58" # libvlc hash that this version of VLCKit is build on
+TESTEDHASH="105babe3" # libvlc hash that this version of VLCKit is build on
 
 usage()
 {
diff --git a/libvlc/patches/0001-Revert-contrib-live555-update-to-2022.07.14.patch b/libvlc/patches/0001-Revert-contrib-live555-update-to-2022.07.14.patch
index 8ee4d104..5b8e7ebd 100644
--- a/libvlc/patches/0001-Revert-contrib-live555-update-to-2022.07.14.patch
+++ b/libvlc/patches/0001-Revert-contrib-live555-update-to-2022.07.14.patch
@@ -1,7 +1,7 @@
-From 13cb8b406cf20d352390006d74373fb3dc354608 Mon Sep 17 00:00:00 2001
+From 0b179d5d3d0e9eb8123739262175e4d9bdbb381e Mon Sep 17 00:00:00 2001
 From: =?UTF-8?q?Felix=20Paul=20K=C3=BChne?= <felix@feepk.net>
 Date: Thu, 11 Aug 2022 11:59:13 +0200
-Subject: [PATCH 01/18] Revert "contrib: live555: update to 2022.07.14"
+Subject: [PATCH 01/14] Revert "contrib: live555: update to 2022.07.14"
 
 This reverts commit 78998cab182bbdbd1915deeead1ad4bc945b514e.
 ---
diff --git a/libvlc/patches/0002-contrib-use-live555-version-that-is-compatible-with-.patch b/libvlc/patches/0002-contrib-use-live555-version-that-is-compatible-with-.patch
index 9f01890b..ba0ea8f4 100644
--- a/libvlc/patches/0002-contrib-use-live555-version-that-is-compatible-with-.patch
+++ b/libvlc/patches/0002-contrib-use-live555-version-that-is-compatible-with-.patch
@@ -1,7 +1,7 @@
-From cea7f345b7cc15aff8b2a9b9f02c01014c3e4cf3 Mon Sep 17 00:00:00 2001
+From dc76f0c2d997a080e083b97e574fe718df2ec1cd Mon Sep 17 00:00:00 2001
 From: Carola Nitz <nitz.carola@googlemail.com>
 Date: Fri, 29 Sep 2017 14:49:02 +0200
-Subject: [PATCH 02/18] contrib: use live555 version that is compatible with
+Subject: [PATCH 02/14] contrib: use live555 version that is compatible with
  LGPL2
 
 ---
diff --git a/libvlc/patches/0003-modules-common-Use-the-full-module-name-as-MODULE_NA.patch b/libvlc/patches/0003-modules-common-Use-the-full-module-name-as-MODULE_NA.patch
index 86db4349..57351cf3 100644
--- a/libvlc/patches/0003-modules-common-Use-the-full-module-name-as-MODULE_NA.patch
+++ b/libvlc/patches/0003-modules-common-Use-the-full-module-name-as-MODULE_NA.patch
@@ -1,7 +1,7 @@
-From 3e27db05de77ba8cef87ab9b676a5d80cff8cb3e Mon Sep 17 00:00:00 2001
+From 95f29fe53365239db5ee840124ce4ae3fc8f2fc6 Mon Sep 17 00:00:00 2001
 From: =?UTF-8?q?Hugo=20Beauz=C3=A9e-Luyssen?= <hugo@beauzee.fr>
 Date: Mon, 26 Mar 2018 16:44:44 +0200
-Subject: [PATCH 03/18] modules:common: Use the full module name as MODULE_NAME
+Subject: [PATCH 03/14] modules:common: Use the full module name as MODULE_NAME
 
 This avoid conflicts when linking modules staticly on platforms that don't have objdump
 ---
diff --git a/libvlc/patches/0004-http-access-retain-auth-struct-for-the-runtime-of-th.patch b/libvlc/patches/0004-http-access-retain-auth-struct-for-the-runtime-of-th.patch
index 0628135a..eafcc0ee 100644
--- a/libvlc/patches/0004-http-access-retain-auth-struct-for-the-runtime-of-th.patch
+++ b/libvlc/patches/0004-http-access-retain-auth-struct-for-the-runtime-of-th.patch
@@ -1,7 +1,7 @@
-From df4c2ffd7b321a8295c49f35c2084cb14a96ccad Mon Sep 17 00:00:00 2001
+From 2dc21bfba299142cf9919d0e0e23234a1d621b58 Mon Sep 17 00:00:00 2001
 From: =?UTF-8?q?Felix=20Paul=20K=C3=BChne?= <felix@feepk.net>
 Date: Mon, 10 Sep 2018 20:55:11 +0200
-Subject: [PATCH 04/18] http access: retain auth struct for the runtime of the
+Subject: [PATCH 04/14] http access: retain auth struct for the runtime of the
  module
 
 Previously, it was retained for a given connection only, so all information needed for a digest login was lost as soon as the module was reconnecting due to the expected 401 on attempted basic login
@@ -11,7 +11,7 @@ Previously, it was retained for a given connection only, so all information need
  2 files changed, 25 insertions(+), 3 deletions(-)
 
 diff --git a/modules/access/http.c b/modules/access/http.c
-index 8d7be65388..04fcb0692e 100644
+index 24a0be5df3..038f16c639 100644
 --- a/modules/access/http.c
 +++ b/modules/access/http.c
 @@ -265,11 +265,15 @@ static int Open( vlc_object_t *p_this )
@@ -59,7 +59,7 @@ index 8d7be65388..04fcb0692e 100644
      p_sys->psz_mime = NULL;
      p_sys->i_icy_meta = 0;
 diff --git a/src/network/http_auth.c b/src/network/http_auth.c
-index 76f91fe7d9..89732fdc3d 100644
+index 0c4a7e58a6..3338e05f3a 100644
 --- a/src/network/http_auth.c
 +++ b/src/network/http_auth.c
 @@ -222,7 +222,10 @@ void vlc_http_auth_ParseWwwAuthenticateHeader(
diff --git a/libvlc/patches/0005-access_output-file-Add-error-dialog-for-write-open.patch b/libvlc/patches/0005-access_output-file-Add-error-dialog-for-write-open.patch
index 6ce0d95a..475138ae 100644
--- a/libvlc/patches/0005-access_output-file-Add-error-dialog-for-write-open.patch
+++ b/libvlc/patches/0005-access_output-file-Add-error-dialog-for-write-open.patch
@@ -1,14 +1,14 @@
-From 3abaac8314ea2f19c7fefb0d96181636b495488d Mon Sep 17 00:00:00 2001
+From 007f1615acc5b73a202515bc1fa12751e1b7106c Mon Sep 17 00:00:00 2001
 From: Soomin Lee <bubu@mikan.io>
 Date: Mon, 1 Oct 2018 15:37:57 +0200
-Subject: [PATCH 05/18] access_output: file: Add error dialog for write/open
+Subject: [PATCH 05/14] access_output: file: Add error dialog for write/open
 
 ---
  modules/access_output/file.c | 8 ++++++++
  1 file changed, 8 insertions(+)
 
 diff --git a/modules/access_output/file.c b/modules/access_output/file.c
-index d4ec686e55..1e86e20f8b 100644
+index 81fdef4379..02bcdb26f2 100644
 --- a/modules/access_output/file.c
 +++ b/modules/access_output/file.c
 @@ -86,6 +86,9 @@ static ssize_t Write( sout_access_out_t *p_access, block_t *p_buffer )
diff --git a/libvlc/patches/0008-webservices-avoid-symbol-conflict.patch b/libvlc/patches/0006-webservices-avoid-symbol-conflict.patch
similarity index 96%
rename from libvlc/patches/0008-webservices-avoid-symbol-conflict.patch
rename to libvlc/patches/0006-webservices-avoid-symbol-conflict.patch
index c11ad735..8974960a 100644
--- a/libvlc/patches/0008-webservices-avoid-symbol-conflict.patch
+++ b/libvlc/patches/0006-webservices-avoid-symbol-conflict.patch
@@ -1,7 +1,7 @@
-From ba18d60d0972e009ed658f0ff361ef586d53ab8f Mon Sep 17 00:00:00 2001
+From 8b66b0f42dee8e5eda9c3e2bb6132536bcd5f57a Mon Sep 17 00:00:00 2001
 From: =?UTF-8?q?Felix=20Paul=20K=C3=BChne?= <felix@feepk.net>
 Date: Mon, 25 Jan 2021 19:56:01 +0100
-Subject: [PATCH 08/18] webservices: avoid symbol conflict
+Subject: [PATCH 06/14] webservices: avoid symbol conflict
 
 ---
  modules/misc/webservices/json.c                   | 2 +-
diff --git a/libvlc/patches/0009-contrib-disable-rust-when-compiling-on-macOS-ARM-64.patch b/libvlc/patches/0007-contrib-disable-rust-when-compiling-on-macOS-ARM-64.patch
similarity index 82%
rename from libvlc/patches/0009-contrib-disable-rust-when-compiling-on-macOS-ARM-64.patch
rename to libvlc/patches/0007-contrib-disable-rust-when-compiling-on-macOS-ARM-64.patch
index 6853ad78..97abed98 100644
--- a/libvlc/patches/0009-contrib-disable-rust-when-compiling-on-macOS-ARM-64.patch
+++ b/libvlc/patches/0007-contrib-disable-rust-when-compiling-on-macOS-ARM-64.patch
@@ -1,14 +1,14 @@
-From 81a1ffd2d0ceb9bc18453df3b0ad8389e76218a2 Mon Sep 17 00:00:00 2001
+From 898a4180bddfd1c1517b96f191c30457d4178324 Mon Sep 17 00:00:00 2001
 From: =?UTF-8?q?Felix=20Paul=20K=C3=BChne?= <felix@feepk.net>
 Date: Mon, 15 Feb 2021 13:44:41 +0100
-Subject: [PATCH 09/18] contrib: disable rust when compiling on macOS ARM-64
+Subject: [PATCH 07/14] contrib: disable rust when compiling on macOS ARM-64
 
 ---
  contrib/src/main-rust.mak | 4 +++-
  1 file changed, 3 insertions(+), 1 deletion(-)
 
 diff --git a/contrib/src/main-rust.mak b/contrib/src/main-rust.mak
-index b642a97d89..e22841e7b4 100644
+index 13025ec17d..3fbc147b49 100644
 --- a/contrib/src/main-rust.mak
 +++ b/contrib/src/main-rust.mak
 @@ -24,9 +24,11 @@ endif
diff --git a/libvlc/patches/0007-extras-disable-rav1e-for-iOS-and-tvOS.patch b/libvlc/patches/0007-extras-disable-rav1e-for-iOS-and-tvOS.patch
deleted file mode 100644
index 5294d6cd..00000000
--- a/libvlc/patches/0007-extras-disable-rav1e-for-iOS-and-tvOS.patch
+++ /dev/null
@@ -1,31 +0,0 @@
-From 6291815c30f27e27431e2c4bb36ed936c249be1e Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Felix=20Paul=20K=C3=BChne?= <felix@feepk.net>
-Date: Mon, 26 Oct 2020 15:47:13 +0100
-Subject: [PATCH 07/18] extras: disable rav1e for iOS and tvOS
-
----
- extras/package/apple/build.conf | 2 ++
- 1 file changed, 2 insertions(+)
-
-diff --git a/extras/package/apple/build.conf b/extras/package/apple/build.conf
-index 7b51b16504..e24903ab8e 100644
---- a/extras/package/apple/build.conf
-+++ b/extras/package/apple/build.conf
-@@ -85,12 +85,14 @@ export VLC_CONTRIB_OPTIONS_MACOSX=(
- # Additional contrib bootstrap options for iOS
- export VLC_CONTRIB_OPTIONS_IOS=(
-     --disable-aom
-+    --disable-rav1e
- )
- 
- # Additional contrib bootstrap options for tvOS
- export VLC_CONTRIB_OPTIONS_TVOS=(
-     --disable-libarchive
-     --disable-aom
-+    --disable-rav1e
- )
- 
- #
--- 
-2.32.1 (Apple Git-133)
-
diff --git a/libvlc/patches/0010-http-add-vlc_http_cookies_clear.patch b/libvlc/patches/0008-http-add-vlc_http_cookies_clear.patch
similarity index 92%
rename from libvlc/patches/0010-http-add-vlc_http_cookies_clear.patch
rename to libvlc/patches/0008-http-add-vlc_http_cookies_clear.patch
index 60ea166f..09d5610d 100644
--- a/libvlc/patches/0010-http-add-vlc_http_cookies_clear.patch
+++ b/libvlc/patches/0008-http-add-vlc_http_cookies_clear.patch
@@ -1,7 +1,7 @@
-From 90607c52c170d22211accc52456ebd7d6a89f6a3 Mon Sep 17 00:00:00 2001
+From 433496f69060039f14fc2af19e22066e26be7835 Mon Sep 17 00:00:00 2001
 From: Thomas Guillem <thomas@gllm.fr>
 Date: Fri, 16 Sep 2016 15:51:10 +0200
-Subject: [PATCH 10/18] http: add vlc_http_cookies_clear
+Subject: [PATCH 08/14] http: add vlc_http_cookies_clear
 
 Clear all cookies without deleting the jar.
 ---
@@ -23,7 +23,7 @@ index 383a1ed354..33d04eb749 100644
  
  /**
 diff --git a/src/libvlccore.sym b/src/libvlccore.sym
-index 28e2d422e2..9a00774ef1 100644
+index f61b9cfb22..bd01a0dd4f 100644
 --- a/src/libvlccore.sym
 +++ b/src/libvlccore.sym
 @@ -142,6 +142,7 @@ vlc_http_auth_ParseAuthenticationInfoHeader
diff --git a/libvlc/patches/0012-contrib-ffmpeg-use-audiotoolbox-on-iOS-for-AC-3.patch b/libvlc/patches/0009-contrib-ffmpeg-use-audiotoolbox-on-iOS-for-AC-3.patch
similarity index 95%
rename from libvlc/patches/0012-contrib-ffmpeg-use-audiotoolbox-on-iOS-for-AC-3.patch
rename to libvlc/patches/0009-contrib-ffmpeg-use-audiotoolbox-on-iOS-for-AC-3.patch
index b1910e96..89006d8f 100644
--- a/libvlc/patches/0012-contrib-ffmpeg-use-audiotoolbox-on-iOS-for-AC-3.patch
+++ b/libvlc/patches/0009-contrib-ffmpeg-use-audiotoolbox-on-iOS-for-AC-3.patch
@@ -1,7 +1,7 @@
-From 6686d94a8f928f5f40fd8f2e128eb6fbbb30de6b Mon Sep 17 00:00:00 2001
+From f87b4919c4303ef93af324fe71e0dd0310ba8ff1 Mon Sep 17 00:00:00 2001
 From: =?UTF-8?q?Felix=20Paul=20K=C3=BChne?= <felix@feepk.net>
 Date: Fri, 22 Jul 2016 11:11:44 +0200
-Subject: [PATCH 12/18] contrib/ffmpeg: use audiotoolbox on iOS for AC-3
+Subject: [PATCH 09/14] contrib/ffmpeg: use audiotoolbox on iOS for AC-3
 
 This enforces the use of the audiotoolbox decoders for AC-3 and E-AC-3
 as introduced in iOS 9 and disables the use of the MLP decoder to be in
diff --git a/libvlc/patches/0013-libvlc_media-add-cookie_jar-API.patch b/libvlc/patches/0010-libvlc_media-add-cookie_jar-API.patch
similarity index 98%
rename from libvlc/patches/0013-libvlc_media-add-cookie_jar-API.patch
rename to libvlc/patches/0010-libvlc_media-add-cookie_jar-API.patch
index e12a9cb2..50a4b192 100644
--- a/libvlc/patches/0013-libvlc_media-add-cookie_jar-API.patch
+++ b/libvlc/patches/0010-libvlc_media-add-cookie_jar-API.patch
@@ -1,7 +1,7 @@
-From ce97c1d6406e5f9ca980f64f1aea07022448b7df Mon Sep 17 00:00:00 2001
+From e37fe5c3dff5f6dda007192cb3954ef8923faf1c Mon Sep 17 00:00:00 2001
 From: Thomas Guillem <thomas@gllm.fr>
 Date: Fri, 16 Sep 2016 15:51:11 +0200
-Subject: [PATCH 13/18] libvlc_media: add cookie_jar API
+Subject: [PATCH 10/14] libvlc_media: add cookie_jar API
 
 ---
  include/vlc/libvlc_media.h |  35 +++++
@@ -16,10 +16,10 @@ Subject: [PATCH 13/18] libvlc_media: add cookie_jar API
  create mode 100644 patch
 
 diff --git a/include/vlc/libvlc_media.h b/include/vlc/libvlc_media.h
-index c095c41010..f75ba251b1 100644
+index 825a7e5f3a..76a32713fe 100644
 --- a/include/vlc/libvlc_media.h
 +++ b/include/vlc/libvlc_media.h
-@@ -867,6 +867,41 @@ LIBVLC_API
+@@ -857,6 +857,41 @@ LIBVLC_API
  void libvlc_media_slaves_release( libvlc_media_slave_t **pp_slaves,
                                    unsigned int i_count );
  
@@ -62,10 +62,10 @@ index c095c41010..f75ba251b1 100644
  
  # ifdef __cplusplus
 diff --git a/lib/libvlc.sym b/lib/libvlc.sym
-index cfa6cd095c..acd9e04adb 100644
+index 7bdf063d4a..b4cdb56919 100644
 --- a/lib/libvlc.sym
 +++ b/lib/libvlc.sym
-@@ -210,6 +210,8 @@ libvlc_media_slaves_release
+@@ -209,6 +209,8 @@ libvlc_media_slaves_release
  libvlc_media_set_meta
  libvlc_media_set_user_data
  libvlc_media_subitems
@@ -372,7 +372,7 @@ index 0000000000..de12fb79fe
 +libvlc_picture_list_count
 +libvlc_picture_list_destroy
 diff --git a/lib/media.c b/lib/media.c
-index 51655d071e..a9b8e9a2e5 100644
+index 8ba0aeef78..004d3f4c28 100644
 --- a/lib/media.c
 +++ b/lib/media.c
 @@ -497,6 +497,7 @@ libvlc_media_t * libvlc_media_new_from_input_item(input_item_t *p_input_item )
@@ -393,7 +393,7 @@ index 51655d071e..a9b8e9a2e5 100644
      libvlc_event_manager_destroy( &p_md->event_manager );
      free( p_md );
  }
-@@ -1241,3 +1245,24 @@ void libvlc_media_slaves_release( libvlc_media_slave_t **pp_slaves,
+@@ -1236,3 +1240,24 @@ void libvlc_media_slaves_release( libvlc_media_slave_t **pp_slaves,
      }
      free( pp_slaves );
  }
diff --git a/libvlc/patches/0014-Add-property-to-configure-an-http-access-token.patch b/libvlc/patches/0011-Add-property-to-configure-an-http-access-token.patch
similarity index 95%
rename from libvlc/patches/0014-Add-property-to-configure-an-http-access-token.patch
rename to libvlc/patches/0011-Add-property-to-configure-an-http-access-token.patch
index 0264a34c..3a820f45 100644
--- a/libvlc/patches/0014-Add-property-to-configure-an-http-access-token.patch
+++ b/libvlc/patches/0011-Add-property-to-configure-an-http-access-token.patch
@@ -1,7 +1,7 @@
-From e3e1ce3a2e319f4f60e06b94f9f6a928da57d443 Mon Sep 17 00:00:00 2001
+From 606841a4b8087f60912a91778ff2578aabcabbab Mon Sep 17 00:00:00 2001
 From: Alex Pilgrim <pilgrim.sa@gmail.com>
 Date: Fri, 21 Feb 2020 12:34:07 +0200
-Subject: [PATCH 14/18] Add property to configure an http access token
+Subject: [PATCH 11/14] Add property to configure an http access token
 
 ---
  modules/access/http/access.c   | 8 ++++++--
diff --git a/libvlc/patches/0011-src-add-hack-to-retain-compilation-support-for-i386.patch b/libvlc/patches/0011-src-add-hack-to-retain-compilation-support-for-i386.patch
deleted file mode 100644
index 768ff9e8..00000000
--- a/libvlc/patches/0011-src-add-hack-to-retain-compilation-support-for-i386.patch
+++ /dev/null
@@ -1,47 +0,0 @@
-From 69aa46516cfd0fac783826fd98d4ee526b29ce63 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Felix=20Paul=20K=C3=BChne?= <felix@feepk.net>
-Date: Thu, 20 Aug 2020 13:56:14 +0200
-Subject: [PATCH 11/18] src: add hack to retain compilation support for i386
-
-This leads to potentially undefined behavior when using the 32bit iOS
-Simulator. This code path never ends-up in production.
----
- src/misc/sort.c    | 4 ++++
- src/posix/thread.c | 4 ++++
- 2 files changed, 8 insertions(+)
-
-diff --git a/src/misc/sort.c b/src/misc/sort.c
-index fc62eb7fff..fa87f72ec5 100644
---- a/src/misc/sort.c
-+++ b/src/misc/sort.c
-@@ -26,7 +26,11 @@
- #include <vlc_common.h>
- #include <vlc_sort.h>
- 
-+#ifdef __i386__
-+static struct
-+#else
- static thread_local struct
-+#endif
- {
-     int (*compar)(const void *, const void *, void *);
-     void *arg;
-diff --git a/src/posix/thread.c b/src/posix/thread.c
-index cbd6996d1d..da9758d357 100644
---- a/src/posix/thread.c
-+++ b/src/posix/thread.c
-@@ -198,7 +198,11 @@ void vlc_join(vlc_thread_t th, void **result)
- 
- VLC_WEAK unsigned long vlc_thread_id(void)
- {
-+#ifdef __i386__
-+     static unsigned char dummy;
-+#else
-      static thread_local unsigned char dummy;
-+#endif
- 
-      static_assert (UINTPTR_MAX <= ULONG_MAX, "Type size mismatch");
-      return (uintptr_t)(void *)&dummy;
--- 
-2.32.1 (Apple Git-133)
-
diff --git a/libvlc/patches/0015-adaptive-NULL-http-token.patch b/libvlc/patches/0012-adaptive-NULL-http-token.patch
similarity index 90%
rename from libvlc/patches/0015-adaptive-NULL-http-token.patch
rename to libvlc/patches/0012-adaptive-NULL-http-token.patch
index bab02a66..c9d49b3d 100644
--- a/libvlc/patches/0015-adaptive-NULL-http-token.patch
+++ b/libvlc/patches/0012-adaptive-NULL-http-token.patch
@@ -1,7 +1,7 @@
-From a79a3266262be3e8edcf960a73e223ab21ac6cfd Mon Sep 17 00:00:00 2001
+From 5ba7f22fb710b656874c01e853b9ee5245ef332d Mon Sep 17 00:00:00 2001
 From: =?UTF-8?q?Felix=20Paul=20K=C3=BChne?= <felix@feepk.net>
 Date: Thu, 6 Jan 2022 01:08:11 +0100
-Subject: [PATCH 15/18] adaptive: NULL http-token
+Subject: [PATCH 12/14] adaptive: NULL http-token
 
 The token property is exclusive to VLCKit to allow passing bearer tokens
  to the http stack. However, it is not used for adaptive streaming, but
diff --git a/libvlc/patches/0017-http-initialize-token-properly.patch b/libvlc/patches/0013-http-initialize-token-properly.patch
similarity index 87%
rename from libvlc/patches/0017-http-initialize-token-properly.patch
rename to libvlc/patches/0013-http-initialize-token-properly.patch
index 32e2bc26..a5220a75 100644
--- a/libvlc/patches/0017-http-initialize-token-properly.patch
+++ b/libvlc/patches/0013-http-initialize-token-properly.patch
@@ -1,7 +1,7 @@
-From 4f610713a8d79147dfc1d91371a3a30b0b849ae2 Mon Sep 17 00:00:00 2001
+From be733ee0ff3a8e8b1cdb19ac336ed42c8a961f9c Mon Sep 17 00:00:00 2001
 From: Maxime Chapelet <umxprime@videolabs.io>
 Date: Wed, 24 Aug 2022 10:39:30 +0200
-Subject: [PATCH 17/18] http : initialize token properly
+Subject: [PATCH 13/14] http : initialize token properly
 
 unititialization caused bad access exceptions when resource was deinit or when its authentication bearer header creation was wrongly attempted
 ---
diff --git a/libvlc/patches/0018-contrib-ffmpeg-fix-cross-compilation-for-macOS-on-ma.patch b/libvlc/patches/0014-contrib-ffmpeg-fix-cross-compilation-for-macOS-on-ma.patch
similarity index 83%
rename from libvlc/patches/0018-contrib-ffmpeg-fix-cross-compilation-for-macOS-on-ma.patch
rename to libvlc/patches/0014-contrib-ffmpeg-fix-cross-compilation-for-macOS-on-ma.patch
index fe0e5c1d..a6e6aca5 100644
--- a/libvlc/patches/0018-contrib-ffmpeg-fix-cross-compilation-for-macOS-on-ma.patch
+++ b/libvlc/patches/0014-contrib-ffmpeg-fix-cross-compilation-for-macOS-on-ma.patch
@@ -1,7 +1,7 @@
-From 820d16d06f245bcd4b285323f6dea430fbf95ff7 Mon Sep 17 00:00:00 2001
+From 64ee3ca3a917bd66a219a28e27b71e5f7cf0556d Mon Sep 17 00:00:00 2001
 From: =?UTF-8?q?Felix=20Paul=20K=C3=BChne?= <felix@feepk.net>
 Date: Tue, 16 Feb 2021 17:04:59 +0100
-Subject: [PATCH 18/18] contrib/ffmpeg: fix cross-compilation for macOS on
+Subject: [PATCH 14/14] contrib/ffmpeg: fix cross-compilation for macOS on
  macOS
 
 ---
diff --git a/libvlc/patches/0016-Fix-compilation-for-32bit-runtimes-without-thread_lo.patch b/libvlc/patches/0016-Fix-compilation-for-32bit-runtimes-without-thread_lo.patch
deleted file mode 100644
index 447b7a54..00000000
--- a/libvlc/patches/0016-Fix-compilation-for-32bit-runtimes-without-thread_lo.patch
+++ /dev/null
@@ -1,189 +0,0 @@
-From 6d6c9705fc3834d8d63b23a252f751d0b740ecf0 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Felix=20Paul=20K=C3=BChne?= <felix@feepk.net>
-Date: Thu, 11 Aug 2022 11:48:14 +0200
-Subject: [PATCH 16/18] Fix compilation for 32bit runtimes without thread_local
-
----
- compat/tdestroy.c    | 67 ++++++++++++++++++++++++++------------------
- include/vlc_fixups.h | 10 ++++---
- src/misc/rcu.c       |  5 ++++
- 3 files changed, 50 insertions(+), 32 deletions(-)
-
-diff --git a/compat/tdestroy.c b/compat/tdestroy.c
-index 6bb3480957..5c54881553 100644
---- a/compat/tdestroy.c
-+++ b/compat/tdestroy.c
-@@ -3,7 +3,7 @@
-  * @brief replacement for GNU tdestroy()
-  */
- /*****************************************************************************
-- * Copyright (C) 2009, 2018 Rémi Denis-Courmont
-+ * Copyright (C) 2009 Rémi Denis-Courmont
-  *
-  * This program is free software; you can redistribute it and/or modify it
-  * under the terms of the GNU Lesser General Public License as published by
-@@ -24,77 +24,88 @@
- # include "config.h"
- #endif
- 
--#include <assert.h>
-+#if defined(HAVE_SEARCH_H) && !defined(HAVE_TDESTROY) && defined(HAVE_TFIND)
-+
- #include <stdlib.h>
--#ifdef HAVE_SEARCH_H
--# include <search.h>
--#endif
-+#include <assert.h>
- 
--#ifdef HAVE_TFIND
--static __thread struct
-+#include <vlc_common.h>
-+#include <search.h>
-+
-+static struct
- {
-     const void **tab;
-     size_t count;
--} list = { NULL, 0 };
-+    vlc_mutex_t lock;
-+} list = { NULL, 0, VLC_STATIC_MUTEX };
- 
--static void list_nodes(const void *node, const VISIT which, const int depth)
-+static void list_nodes (const void *node, const VISIT which, const int depth)
- {
-     (void) depth;
- 
-     if (which != postorder && which != leaf)
-         return;
- 
--    const void **tab = realloc(list.tab, sizeof (*tab) * (list.count + 1));
--    if (tab == NULL)
--        abort();
-+    const void **tab = realloc (list.tab, sizeof (*tab) * (list.count + 1));
-+    if (unlikely(tab == NULL))
-+        abort ();
- 
-     tab[list.count] = *(const void **)node;
-     list.tab = tab;
-     list.count++;
- }
- 
--static __thread const void *smallest;
-+static struct
-+{
-+    const void *node;
-+    vlc_mutex_t lock;
-+} smallest = { NULL, VLC_STATIC_MUTEX };
- 
--static int cmp_smallest(const void *a, const void *b)
-+static int cmp_smallest (const void *a, const void *b)
- {
-     if (a == b)
-         return 0;
--    if (a == smallest)
-+    if (a == smallest.node)
-         return -1;
--    if (b == smallest)
-+    if (likely(b == smallest.node))
-         return +1;
--    abort();
-+    abort ();
- }
- 
--void tdestroy(void *root, void (*freenode)(void *))
-+void vlc_tdestroy (void *root, void (*freenode) (void *))
- {
-     const void **tab;
-     size_t count;
- 
--    assert(freenode != NULL);
-+    assert (freenode != NULL);
- 
-     /* Enumerate nodes in order */
--    assert(list.count == 0);
--    twalk(root, list_nodes);
-+    vlc_mutex_lock (&list.lock);
-+    assert (list.count == 0);
-+    twalk (root, list_nodes);
-     tab = list.tab;
-     count = list.count;
-     list.tab = NULL;
-     list.count = 0;
-+    vlc_mutex_unlock (&list.lock);
- 
-     /* Destroy the tree */
-+    vlc_mutex_lock (&smallest.lock);
-     for (size_t i = 0; i < count; i++)
-     {
--         void *node = (void *)(tab[i]);
-+         void *node  = tab[i];
- 
--         smallest = node;
--         node = tdelete(node, &root, cmp_smallest);
--         assert(node != NULL);
-+         smallest.node = node;
-+         node = tdelete (node, &root, cmp_smallest);
-+         assert (node != NULL);
-     }
-+    vlc_mutex_unlock (&smallest.lock);
-     assert (root == NULL);
- 
-     /* Destroy the nodes */
-     for (size_t i = 0; i < count; i++)
--         freenode((void *)(tab[i]));
--    free(tab);
-+         freenode ((void *)(tab[i]));
-+    free (tab);
- }
--#endif /* HAVE_TFIND */
-+
-+#endif
-diff --git a/include/vlc_fixups.h b/include/vlc_fixups.h
-index c41a6c6eea..97c28e053c 100644
---- a/include/vlc_fixups.h
-+++ b/include/vlc_fixups.h
-@@ -506,7 +506,13 @@ void twalk( const void *root, void(*action)(const void *nodep, VISIT which, int
- /* the Win32 prototype of lfind() expects an unsigned* for 'nelp' */
- void *lfind( const void *key, const void *base, size_t *nmemb,
-              size_t size, int(*cmp)(const void *, const void *) );
-+void tdestroy( void *root, void (*free_node)(void *nodep) );
- #endif
-+#else // HAVE_SEARCH_H
-+# ifndef HAVE_TDESTROY
-+void vlc_tdestroy( void *, void (*)(void *) );
-+#  define tdestroy vlc_tdestroy
-+# endif
- #endif /* HAVE_SEARCH_H */
- 
- #ifdef _WIN64
-@@ -518,10 +524,6 @@ void *lfind( const void *key, const void *base, size_t *nmemb,
-          lfind((a),(b), &(unsigned){ (*(c) > UINT_MAX) ? UINT_MAX : *(c) }, (d),(e))
- #endif /* _WIN64 */
- 
--#ifndef HAVE_TDESTROY
--void tdestroy( void *root, void (*free_node)(void *nodep) );
--#endif
--
- /* sys/auxv.h */
- #ifndef HAVE_GETAUXVAL
- unsigned long getauxval(unsigned long);
-diff --git a/src/misc/rcu.c b/src/misc/rcu.c
-index 63d913c247..0577f431bb 100644
---- a/src/misc/rcu.c
-+++ b/src/misc/rcu.c
-@@ -40,7 +40,12 @@ struct vlc_rcu_thread {
-     uintptr_t recursion;
- };
- 
-+
-+#if defined (__i386__)
-+static struct vlc_rcu_thread current;
-+#else
- static _Thread_local struct vlc_rcu_thread current;
-+#endif
- 
- bool vlc_rcu_read_held(void)
- {
--- 
-2.32.1 (Apple Git-133)
-
-- 
GitLab