From e2f90bd48870037da3744a7b9725eaa8da9554c0 Mon Sep 17 00:00:00 2001
From: Steve Lhomme <robux4@ycbcr.xyz>
Date: Thu, 2 Apr 2020 15:41:36 +0200
Subject: [PATCH] Update libvlc patchset

The libarchive patches need some updating after updating to 3.4.0.

The patches can be found in https://code.videolan.org/robUx4/vlc-3.0/-/tree/winstore/5
---
 ...nnot_unload_broken_library-for-winrt.patch |  4 +-
 ...02-Cheat-for-Windows-Store-subtitles.patch |  4 +-
 .../0003-Accept-the-weird-WinRT-pathes.patch  |  4 +-
 ...dows-doesn-t-like-relative-pathes-in.patch |  4 +-
 ...se-bcrypt-instead-of-the-old-wincryp.patch |  4 +-
 ...dec-use-a-more-recent-FFmpeg-version.patch |  4 +-
 ...on-t-use-forbidden-APIs-on-Phone-app.patch |  4 +-
 ...555-version-that-is-compatible-with-.patch |  8 +-
 ...instead-of-CryptographicBufferStatic.patch |  6 +-
 ...tls-fix-Winstore-forbidden-API-calls.patch |  4 +-
 ...spect-the-availability-of-strings.h-.patch |  4 +-
 ...meval-is-defined-in-winsock2.h-on-Wi.patch |  4 +-
 ...cklen_t-can-be-found-in-ws2tcpip.h-o.patch |  4 +-
 ...rypt-use-bcrypt-rather-than-wincrypt.patch |  4 +-
 ...hive-use-bcrypt-rather-than-wincrypt.patch |  4 +-
 ...-include-the-decoder-padding-in-the-.patch |  4 +-
 ...sible-dimensions-are-unlikely-to-be-.patch |  4 +-
 ...set-of-functions-to-use-a-plain-FIFO.patch |  4 +-
 ...ATCH-to-encode-from-CPU-planes-prope.patch |  4 +-
 ...t-try-to-encode-with-QSV-if-possible.patch |  4 +-
 ...ve-use-the-proper-define-for-the-int.patch | 83 ++++++++-----------
 ...2-contrib-libarchive-Fix-winrt-build.patch |  4 +-
 ...tribs-Fix-ffmpeg-build-with-gcrypt.h.patch |  4 +-
 ...-Fix-gnutls-UWP-build-with-mingw-w64.patch |  4 +-
 ...on-closesocket-when-a-poll-is-pendin.patch |  4 +-
 ...peg-Don-t-check-for-wincrypt-anymore.patch |  4 +-
 ...se-winstorecompat-overload-when-avai.patch |  4 +-
 ...ntrib-mpg123-Simplify-unicode-checks.patch |  4 +-
 ...contrib-libarchive-fix-winrt-patches.patch | 31 +++++++
 ...-force-the-Windows-version-to-target.patch | 77 +++++++++++++++++
 30 files changed, 200 insertions(+), 105 deletions(-)
 create mode 100644 libvlc/patches/0029-contrib-libarchive-fix-winrt-patches.patch
 create mode 100644 libvlc/patches/0030-libarchive-don-t-force-the-Windows-version-to-target.patch

diff --git a/libvlc/patches/0001-gnutls-Set-cannot_unload_broken_library-for-winrt.patch b/libvlc/patches/0001-gnutls-Set-cannot_unload_broken_library-for-winrt.patch
index 78c7889b9..a60dda08d 100644
--- a/libvlc/patches/0001-gnutls-Set-cannot_unload_broken_library-for-winrt.patch
+++ b/libvlc/patches/0001-gnutls-Set-cannot_unload_broken_library-for-winrt.patch
@@ -1,7 +1,7 @@
-From 0d263d5b2142496e68fcf0d8debf06eda4798296 Mon Sep 17 00:00:00 2001
+From 36f5329097de58cd8b555114b5ff40dd9aff72fb Mon Sep 17 00:00:00 2001
 From: =?UTF-8?q?Hugo=20Beauz=C3=A9e-Luyssen?= <hugo@beauzee.fr>
 Date: Wed, 11 May 2016 17:37:47 +0200
-Subject: [PATCH 01/28] gnutls: Set cannot_unload_broken_library for winrt
+Subject: [PATCH 01/30] gnutls: Set cannot_unload_broken_library for winrt
 
 ---
  modules/misc/gnutls.c | 3 +++
diff --git a/libvlc/patches/0002-Cheat-for-Windows-Store-subtitles.patch b/libvlc/patches/0002-Cheat-for-Windows-Store-subtitles.patch
index 31494c0b7..d7c564d1c 100644
--- a/libvlc/patches/0002-Cheat-for-Windows-Store-subtitles.patch
+++ b/libvlc/patches/0002-Cheat-for-Windows-Store-subtitles.patch
@@ -1,7 +1,7 @@
-From 341dd0a05570aa6f2ea130e4dc737fdf57640001 Mon Sep 17 00:00:00 2001
+From 5291be0bdf706fc63ba291df1271ee99326f61bc Mon Sep 17 00:00:00 2001
 From: Jean-Baptiste Kempf <jb@videolan.org>
 Date: Wed, 16 Apr 2014 16:09:53 +0200
-Subject: [PATCH 02/28] Cheat for Windows Store subtitles
+Subject: [PATCH 02/30] Cheat for Windows Store subtitles
 
 ---
  lib/video.c | 5 +++++
diff --git a/libvlc/patches/0003-Accept-the-weird-WinRT-pathes.patch b/libvlc/patches/0003-Accept-the-weird-WinRT-pathes.patch
index bbb7b3281..3fa205de2 100644
--- a/libvlc/patches/0003-Accept-the-weird-WinRT-pathes.patch
+++ b/libvlc/patches/0003-Accept-the-weird-WinRT-pathes.patch
@@ -1,7 +1,7 @@
-From 7f24b9073244b6e9f87b52f9ea4ff3bc670a7546 Mon Sep 17 00:00:00 2001
+From 87bdcd823e6b52dead3b912c5283ec7bb7e85ac4 Mon Sep 17 00:00:00 2001
 From: Jean-Baptiste Kempf <jb@videolan.org>
 Date: Wed, 12 Mar 2014 00:11:26 +0100
-Subject: [PATCH 03/28] Accept the weird WinRT pathes
+Subject: [PATCH 03/30] Accept the weird WinRT pathes
 
 ---
  src/text/url.c | 5 +++++
diff --git a/libvlc/patches/0004-plugin-cache-Windows-doesn-t-like-relative-pathes-in.patch b/libvlc/patches/0004-plugin-cache-Windows-doesn-t-like-relative-pathes-in.patch
index c32527f89..ae5468b14 100644
--- a/libvlc/patches/0004-plugin-cache-Windows-doesn-t-like-relative-pathes-in.patch
+++ b/libvlc/patches/0004-plugin-cache-Windows-doesn-t-like-relative-pathes-in.patch
@@ -1,7 +1,7 @@
-From 462d4f1efc7bfadceee4f576ac77d0cde62e7608 Mon Sep 17 00:00:00 2001
+From bfe9ff5796104e7f0f2d8beab464acd32383bac1 Mon Sep 17 00:00:00 2001
 From: Steve Lhomme <robux4@videolabs.io>
 Date: Fri, 30 Sep 2016 09:49:19 +0200
-Subject: [PATCH 04/28] plugin cache: Windows doesn't like relative pathes in
+Subject: [PATCH 04/30] plugin cache: Windows doesn't like relative pathes in
  LoadLibraryEx()
 
 Fixes "vlc-cache-gen ../modules" on Windows and general VLC_PLUGIN_PATH usage.
diff --git a/libvlc/patches/0005-contrib-ffmpeg-use-bcrypt-instead-of-the-old-wincryp.patch b/libvlc/patches/0005-contrib-ffmpeg-use-bcrypt-instead-of-the-old-wincryp.patch
index 2bfa8cab2..8192e0d4a 100644
--- a/libvlc/patches/0005-contrib-ffmpeg-use-bcrypt-instead-of-the-old-wincryp.patch
+++ b/libvlc/patches/0005-contrib-ffmpeg-use-bcrypt-instead-of-the-old-wincryp.patch
@@ -1,7 +1,7 @@
-From 39243888b299b3294ffe4a1465f80dc0e2868c01 Mon Sep 17 00:00:00 2001
+From 61e9203e5f2e00844b17d763b96be566ba0c55c2 Mon Sep 17 00:00:00 2001
 From: Steve Lhomme <robux4@ycbcr.xyz>
 Date: Thu, 29 Mar 2018 15:46:11 +0200
-Subject: [PATCH 05/28] contrib: ffmpeg: use bcrypt instead of the old wincrypt
+Subject: [PATCH 05/30] contrib: ffmpeg: use bcrypt instead of the old wincrypt
  API
 
 When targeting Windows Vista and above
diff --git a/libvlc/patches/0006-contrib-avcodec-use-a-more-recent-FFmpeg-version.patch b/libvlc/patches/0006-contrib-avcodec-use-a-more-recent-FFmpeg-version.patch
index 05e45ecd7..5b49ba849 100644
--- a/libvlc/patches/0006-contrib-avcodec-use-a-more-recent-FFmpeg-version.patch
+++ b/libvlc/patches/0006-contrib-avcodec-use-a-more-recent-FFmpeg-version.patch
@@ -1,7 +1,7 @@
-From dc204a2e799428d9c17a6d2624c0ee73b724825f Mon Sep 17 00:00:00 2001
+From df64fa75959cd1cf047eec20c6cf51a48102d1c6 Mon Sep 17 00:00:00 2001
 From: Steve Lhomme <robux4@videolabs.io>
 Date: Tue, 19 Dec 2017 12:39:06 +0100
-Subject: [PATCH 06/28] contrib:avcodec: use a more recent FFmpeg version
+Subject: [PATCH 06/30] contrib:avcodec: use a more recent FFmpeg version
 
 So that it doesn't use bogus atomics based code
 ---
diff --git a/libvlc/patches/0007-contrib-mpg123-don-t-use-forbidden-APIs-on-Phone-app.patch b/libvlc/patches/0007-contrib-mpg123-don-t-use-forbidden-APIs-on-Phone-app.patch
index 2efdfea4c..f5245db93 100644
--- a/libvlc/patches/0007-contrib-mpg123-don-t-use-forbidden-APIs-on-Phone-app.patch
+++ b/libvlc/patches/0007-contrib-mpg123-don-t-use-forbidden-APIs-on-Phone-app.patch
@@ -1,7 +1,7 @@
-From bb47c116178ae32b3f6a3906a2b5a1c121671706 Mon Sep 17 00:00:00 2001
+From db99bf8e6117b24cd74e709ce1021879e8705ccc Mon Sep 17 00:00:00 2001
 From: Steve Lhomme <robux4@ycbcr.xyz>
 Date: Tue, 20 Feb 2018 11:24:43 +0100
-Subject: [PATCH 07/28] contrib:mpg123: don't use forbidden APIs on Phone apps
+Subject: [PATCH 07/30] contrib:mpg123: don't use forbidden APIs on Phone apps
 
 ---
  contrib/src/mpg123/mpg123-winstore.patch | 11 +++++++++++
diff --git a/libvlc/patches/0008-contrib-use-live555-version-that-is-compatible-with-.patch b/libvlc/patches/0008-contrib-use-live555-version-that-is-compatible-with-.patch
index e60c58e05..0a0370b43 100644
--- a/libvlc/patches/0008-contrib-use-live555-version-that-is-compatible-with-.patch
+++ b/libvlc/patches/0008-contrib-use-live555-version-that-is-compatible-with-.patch
@@ -1,7 +1,7 @@
-From 9b27d3dd2e6b3ceb10e3f86afc6504ca389b28c6 Mon Sep 17 00:00:00 2001
+From 565aec3e5b7a8d672ac0acebdb2ae20281c25988 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 08/28] contrib: use live555 version that is compatible with
+Subject: [PATCH 08/30] contrib: use live555 version that is compatible with
  LGPL2
 
 ---
@@ -18,7 +18,7 @@ index f459fb9d16..02b2a69734 100644
 +10846fd6d5482bbea131ae805137077997e9dec242665e3c01d699d5584154c65049e8c520ea855599e554154a148e61fea77b592d97c814a4a98c773658d8f5  live.2016.10.21.tar.gz
 \ No newline at end of file
 diff --git a/contrib/src/live555/rules.mak b/contrib/src/live555/rules.mak
-index bb1d5655c7..41fc1c6179 100644
+index 3bb8e78b3d..4e7281bc56 100644
 --- a/contrib/src/live555/rules.mak
 +++ b/contrib/src/live555/rules.mak
 @@ -1,14 +1,12 @@
@@ -37,7 +37,7 @@ index bb1d5655c7..41fc1c6179 100644
  
  ifeq ($(call need_pkg,"live555"),)
  PKGS_FOUND += live555
-@@ -92,7 +90,6 @@ endif
+@@ -93,7 +91,6 @@ endif
  SUBDIRS=groupsock liveMedia UsageEnvironment BasicUsageEnvironment
  
  .live555: live555
diff --git a/libvlc/patches/0009-rand-use-bcrypt-instead-of-CryptographicBufferStatic.patch b/libvlc/patches/0009-rand-use-bcrypt-instead-of-CryptographicBufferStatic.patch
index eb65aefef..79068a91e 100644
--- a/libvlc/patches/0009-rand-use-bcrypt-instead-of-CryptographicBufferStatic.patch
+++ b/libvlc/patches/0009-rand-use-bcrypt-instead-of-CryptographicBufferStatic.patch
@@ -1,7 +1,7 @@
-From 7c60eaba13f91cde81c2d28f7999826ff5308016 Mon Sep 17 00:00:00 2001
+From 94e6103114c7519d66346fc7810e888fcfbc60de Mon Sep 17 00:00:00 2001
 From: Steve Lhomme <robux4@ycbcr.xyz>
 Date: Tue, 27 Mar 2018 18:57:41 +0200
-Subject: [PATCH 09/28] rand: use bcrypt instead of CryptographicBufferStatics
+Subject: [PATCH 09/30] rand: use bcrypt instead of CryptographicBufferStatics
  for Winstore builds
 
 It's available to winstore apps and on desktop since Vista.
@@ -12,7 +12,7 @@ The old API is deprecated.
  2 files changed, 15 insertions(+), 40 deletions(-)
 
 diff --git a/configure.ac b/configure.ac
-index 7b192eccd5..a14694f7b8 100644
+index c60fd78e11..9922b4ba3b 100644
 --- a/configure.ac
 +++ b/configure.ac
 @@ -1138,7 +1138,10 @@ AH_BOTTOM([
diff --git a/libvlc/patches/0010-contrib-gnutls-fix-Winstore-forbidden-API-calls.patch b/libvlc/patches/0010-contrib-gnutls-fix-Winstore-forbidden-API-calls.patch
index 1d3ffbbd5..f2bca184d 100644
--- a/libvlc/patches/0010-contrib-gnutls-fix-Winstore-forbidden-API-calls.patch
+++ b/libvlc/patches/0010-contrib-gnutls-fix-Winstore-forbidden-API-calls.patch
@@ -1,7 +1,7 @@
-From 6151e1d985cc21227d1ec393215bf58cabc855ad Mon Sep 17 00:00:00 2001
+From 6c6e732bd63e4c9774887e6cf6e8e0daa5405539 Mon Sep 17 00:00:00 2001
 From: Steve Lhomme <robux4@videolabs.io>
 Date: Mon, 23 May 2016 09:18:17 +0200
-Subject: [PATCH 10/28] contrib: gnutls: fix Winstore forbidden API calls
+Subject: [PATCH 10/30] contrib: gnutls: fix Winstore forbidden API calls
 
 ---
  contrib/src/gnutls/rules.mak      |   3 +
diff --git a/libvlc/patches/0011-contrib-shout-respect-the-availability-of-strings.h-.patch b/libvlc/patches/0011-contrib-shout-respect-the-availability-of-strings.h-.patch
index 1cc07b298..f0e928f0e 100644
--- a/libvlc/patches/0011-contrib-shout-respect-the-availability-of-strings.h-.patch
+++ b/libvlc/patches/0011-contrib-shout-respect-the-availability-of-strings.h-.patch
@@ -1,7 +1,7 @@
-From 725c91931c64ff9670b3bede6dd45db75c67e292 Mon Sep 17 00:00:00 2001
+From 5c57b962f40d1be3a74922a482e4c50f3b07cfe3 Mon Sep 17 00:00:00 2001
 From: Steve Lhomme <robux4@ycbcr.xyz>
 Date: Thu, 29 Mar 2018 15:00:53 +0200
-Subject: [PATCH 11/28] contrib: shout: respect the availability of strings.h
+Subject: [PATCH 11/30] contrib: shout: respect the availability of strings.h
  everywhere
 
 ---
diff --git a/libvlc/patches/0012-contrib-shout-timeval-is-defined-in-winsock2.h-on-Wi.patch b/libvlc/patches/0012-contrib-shout-timeval-is-defined-in-winsock2.h-on-Wi.patch
index f864e413c..3a3bdae6d 100644
--- a/libvlc/patches/0012-contrib-shout-timeval-is-defined-in-winsock2.h-on-Wi.patch
+++ b/libvlc/patches/0012-contrib-shout-timeval-is-defined-in-winsock2.h-on-Wi.patch
@@ -1,7 +1,7 @@
-From b36befb27427a6b787a637ddd83852f46ee73d87 Mon Sep 17 00:00:00 2001
+From 40a7e33739e499194e1489ce51659c107b5a4d3e Mon Sep 17 00:00:00 2001
 From: Steve Lhomme <robux4@ycbcr.xyz>
 Date: Thu, 29 Mar 2018 15:06:53 +0200
-Subject: [PATCH 12/28] contrib: shout: timeval is defined in winsock2.h on
+Subject: [PATCH 12/30] contrib: shout: timeval is defined in winsock2.h on
  Windows
 
 ---
diff --git a/libvlc/patches/0013-contrib-shout-socklen_t-can-be-found-in-ws2tcpip.h-o.patch b/libvlc/patches/0013-contrib-shout-socklen_t-can-be-found-in-ws2tcpip.h-o.patch
index 876cabeae..3038d2637 100644
--- a/libvlc/patches/0013-contrib-shout-socklen_t-can-be-found-in-ws2tcpip.h-o.patch
+++ b/libvlc/patches/0013-contrib-shout-socklen_t-can-be-found-in-ws2tcpip.h-o.patch
@@ -1,7 +1,7 @@
-From 00a297567e4b3ef43583c051df418a50a64bb25c Mon Sep 17 00:00:00 2001
+From f5fa91d807b80e9563148a1569745152f7ad12d3 Mon Sep 17 00:00:00 2001
 From: Steve Lhomme <robux4@ycbcr.xyz>
 Date: Thu, 29 Mar 2018 15:13:55 +0200
-Subject: [PATCH 13/28] contrib: shout: socklen_t can be found in ws2tcpip.h on
+Subject: [PATCH 13/30] contrib: shout: socklen_t can be found in ws2tcpip.h on
  Windows
 
 and make sure it's found on Windows Store builds as well
diff --git a/libvlc/patches/0014-contrib-gcrypt-use-bcrypt-rather-than-wincrypt.patch b/libvlc/patches/0014-contrib-gcrypt-use-bcrypt-rather-than-wincrypt.patch
index 6e0ae0c0a..421a45727 100644
--- a/libvlc/patches/0014-contrib-gcrypt-use-bcrypt-rather-than-wincrypt.patch
+++ b/libvlc/patches/0014-contrib-gcrypt-use-bcrypt-rather-than-wincrypt.patch
@@ -1,7 +1,7 @@
-From 5954a98c01771f4026fd51bbf8937da3d1705009 Mon Sep 17 00:00:00 2001
+From 79e60263620ae725eac498ae2564e62db70cb272 Mon Sep 17 00:00:00 2001
 From: Steve Lhomme <robux4@ycbcr.xyz>
 Date: Thu, 5 Apr 2018 13:29:40 +0200
-Subject: [PATCH 14/28] contrib: gcrypt: use bcrypt rather than wincrypt
+Subject: [PATCH 14/30] contrib: gcrypt: use bcrypt rather than wincrypt
 
 ---
  contrib/src/gcrypt/winrt.patch | 177 +++++++++++++++++++++++----------
diff --git a/libvlc/patches/0015-contrib-libarchive-use-bcrypt-rather-than-wincrypt.patch b/libvlc/patches/0015-contrib-libarchive-use-bcrypt-rather-than-wincrypt.patch
index 3e7293d61..d453278e8 100644
--- a/libvlc/patches/0015-contrib-libarchive-use-bcrypt-rather-than-wincrypt.patch
+++ b/libvlc/patches/0015-contrib-libarchive-use-bcrypt-rather-than-wincrypt.patch
@@ -1,7 +1,7 @@
-From f26cdd39675b5c427159e72054b4d54d83b3483a Mon Sep 17 00:00:00 2001
+From a228fc752bd2ef3236a01cfc61c1aacf11f2da69 Mon Sep 17 00:00:00 2001
 From: Steve Lhomme <robux4@ycbcr.xyz>
 Date: Thu, 5 Apr 2018 14:49:26 +0200
-Subject: [PATCH 15/28] contrib: libarchive: use bcrypt rather than wincrypt
+Subject: [PATCH 15/30] contrib: libarchive: use bcrypt rather than wincrypt
 
 ---
  .../libarchive/libarchive-win32-bcrypt.patch  | 145 ++++++++++++++++++
diff --git a/libvlc/patches/0016-transcode-do-not-include-the-decoder-padding-in-the-.patch b/libvlc/patches/0016-transcode-do-not-include-the-decoder-padding-in-the-.patch
index b5bb92658..3f46e7870 100644
--- a/libvlc/patches/0016-transcode-do-not-include-the-decoder-padding-in-the-.patch
+++ b/libvlc/patches/0016-transcode-do-not-include-the-decoder-padding-in-the-.patch
@@ -1,7 +1,7 @@
-From 769ff768b83375082efbfcd7d39c84e8ed9910e1 Mon Sep 17 00:00:00 2001
+From 940a44915c1c10180c0081f162c4dcd04877e2a4 Mon Sep 17 00:00:00 2001
 From: Steve Lhomme <robux4@ycbcr.xyz>
 Date: Wed, 4 Apr 2018 12:10:17 +0200
-Subject: [PATCH 16/28] transcode: do not include the decoder padding in the
+Subject: [PATCH 16/30] transcode: do not include the decoder padding in the
  output SAR
 
 ---
diff --git a/libvlc/patches/0017-transcode-the-visible-dimensions-are-unlikely-to-be-.patch b/libvlc/patches/0017-transcode-the-visible-dimensions-are-unlikely-to-be-.patch
index 46d3c17d7..e74fd0c9f 100644
--- a/libvlc/patches/0017-transcode-the-visible-dimensions-are-unlikely-to-be-.patch
+++ b/libvlc/patches/0017-transcode-the-visible-dimensions-are-unlikely-to-be-.patch
@@ -1,7 +1,7 @@
-From 813d7c682e7ef764365216c55d46cd0bd008138e Mon Sep 17 00:00:00 2001
+From d70032281e8a3f6b3988ce20eb76124ab2fc4449 Mon Sep 17 00:00:00 2001
 From: Steve Lhomme <robux4@videolabs.io>
 Date: Thu, 14 Dec 2017 14:20:25 +0100
-Subject: [PATCH 17/28] transcode: the visible dimensions are unlikely to be 0
+Subject: [PATCH 17/30] transcode: the visible dimensions are unlikely to be 0
 
 ---
  modules/stream_out/transcode/video.c | 4 ++--
diff --git a/libvlc/patches/0018-codec-add-a-set-of-functions-to-use-a-plain-FIFO.patch b/libvlc/patches/0018-codec-add-a-set-of-functions-to-use-a-plain-FIFO.patch
index fc840286f..55eddf78d 100644
--- a/libvlc/patches/0018-codec-add-a-set-of-functions-to-use-a-plain-FIFO.patch
+++ b/libvlc/patches/0018-codec-add-a-set-of-functions-to-use-a-plain-FIFO.patch
@@ -1,7 +1,7 @@
-From 6cde4a519081763999327e926cbaf2c03ddb3cee Mon Sep 17 00:00:00 2001
+From 3c35e7ab21aee6b99332b08797d649502e4a68bc Mon Sep 17 00:00:00 2001
 From: Steve Lhomme <robux4@videolabs.io>
 Date: Mon, 4 Sep 2017 13:59:25 +0200
-Subject: [PATCH 18/28] codec: add a set of functions to use a plain FIFO
+Subject: [PATCH 18/30] codec: add a set of functions to use a plain FIFO
 
 It's similar to the block FIFO but with no locking.
 ---
diff --git a/libvlc/patches/0019-qsv-CUMULATIVE-PATCH-to-encode-from-CPU-planes-prope.patch b/libvlc/patches/0019-qsv-CUMULATIVE-PATCH-to-encode-from-CPU-planes-prope.patch
index c36c85194..a99b4657a 100644
--- a/libvlc/patches/0019-qsv-CUMULATIVE-PATCH-to-encode-from-CPU-planes-prope.patch
+++ b/libvlc/patches/0019-qsv-CUMULATIVE-PATCH-to-encode-from-CPU-planes-prope.patch
@@ -1,7 +1,7 @@
-From 434dd2742a3fbbb3b774b1ba569f05bbd5fa8dd9 Mon Sep 17 00:00:00 2001
+From 3fa06b4ee19b5b14013bb603b8d446af70625140 Mon Sep 17 00:00:00 2001
 From: Steve Lhomme <robux4@videolabs.io>
 Date: Thu, 31 Aug 2017 18:02:31 +0200
-Subject: [PATCH 19/28] qsv: CUMULATIVE PATCH to encode from CPU planes
+Subject: [PATCH 19/30] qsv: CUMULATIVE PATCH to encode from CPU planes
  properly
 
 ---
diff --git a/libvlc/patches/0020-chromecast-try-to-encode-with-QSV-if-possible.patch b/libvlc/patches/0020-chromecast-try-to-encode-with-QSV-if-possible.patch
index f5059ae20..5f35c384c 100644
--- a/libvlc/patches/0020-chromecast-try-to-encode-with-QSV-if-possible.patch
+++ b/libvlc/patches/0020-chromecast-try-to-encode-with-QSV-if-possible.patch
@@ -1,7 +1,7 @@
-From fe89d643908ed3f2a9632a549bb709c517f54889 Mon Sep 17 00:00:00 2001
+From 93229e193c46d616095d619e318bb24cf37880f9 Mon Sep 17 00:00:00 2001
 From: Steve Lhomme <robux4@ycbcr.xyz>
 Date: Thu, 5 Apr 2018 09:49:44 +0200
-Subject: [PATCH 20/28] chromecast: try to encode with QSV if possible
+Subject: [PATCH 20/30] chromecast: try to encode with QSV if possible
 
 It will be handled by the GPU so use less resource.
 ---
diff --git a/libvlc/patches/0021-contrib-libarchive-use-the-proper-define-for-the-int.patch b/libvlc/patches/0021-contrib-libarchive-use-the-proper-define-for-the-int.patch
index 9c8d5dd36..89456829d 100644
--- a/libvlc/patches/0021-contrib-libarchive-use-the-proper-define-for-the-int.patch
+++ b/libvlc/patches/0021-contrib-libarchive-use-the-proper-define-for-the-int.patch
@@ -1,21 +1,21 @@
-From 36779be322801c8bb4d0559244bbac682ca23e79 Mon Sep 17 00:00:00 2001
+From ab912b9c57c9d77a61381a9f93b97b6f4ebd4373 Mon Sep 17 00:00:00 2001
 From: Steve Lhomme <robux4@ycbcr.xyz>
 Date: Fri, 27 Mar 2020 16:33:33 +0100
-Subject: [PATCH 21/28] contrib: libarchive: use the proper define for the
+Subject: [PATCH 21/30] contrib: libarchive: use the proper define for the
  internal mode_t
 
 ---
- ...try-use-the-proper-define-for-mode_t.patch | 43 +++++++++++++++++++
- contrib/src/libarchive/rules.mak              |  1 +
- 2 files changed, 44 insertions(+)
- create mode 100644 contrib/src/libarchive/0002-archive_entry-use-the-proper-define-for-mode_t.patch
+ contrib/src/libarchive/fix-types.patch | 24 +++++++++++++++++++-----
+ 1 file changed, 19 insertions(+), 5 deletions(-)
 
-diff --git a/contrib/src/libarchive/0002-archive_entry-use-the-proper-define-for-mode_t.patch b/contrib/src/libarchive/0002-archive_entry-use-the-proper-define-for-mode_t.patch
-new file mode 100644
-index 0000000000..14c3216e13
---- /dev/null
-+++ b/contrib/src/libarchive/0002-archive_entry-use-the-proper-define-for-mode_t.patch
-@@ -0,0 +1,43 @@
+diff --git a/contrib/src/libarchive/fix-types.patch b/contrib/src/libarchive/fix-types.patch
+index 3285058337..14c3216e13 100644
+--- a/contrib/src/libarchive/fix-types.patch
++++ b/contrib/src/libarchive/fix-types.patch
+@@ -1,6 +1,17 @@
+---- libarchive/libarchive/archive_entry.c	2017-07-18 15:27:58.259298500 +0200
+-+++ libarchive/libarchive/archive_entry.c.types	2017-07-18 15:21:43.800236200 +0200
+-@@ -348,7 +348,7 @@ archive_entry_devminor(struct archive_en
 +From 93a8b303904e40261ac58fbd95eb338d6b9cb1df Mon Sep 17 00:00:00 2001
 +From: Steve Lhomme <robux4@ycbcr.xyz>
 +Date: Fri, 27 Mar 2020 16:26:07 +0100
@@ -30,47 +30,34 @@ index 0000000000..14c3216e13
 +--- a/libarchive/archive_entry.c
 ++++ b/libarchive/archive_entry.c
 +@@ -353,7 +353,7 @@ archive_entry_devminor(struct archive_entry *entry)
-+ 		return minor(entry->ae_stat.aest_dev);
-+ }
-+ 
-+-mode_t
-++__LA_MODE_T
-+ archive_entry_filetype(struct archive_entry *entry)
-+ {
-+ 	return (AE_IFMT & entry->acl.mode);
+  		return minor(entry->ae_stat.aest_dev);
+  }
+  
+@@ -9,7 +20,7 @@
+  archive_entry_filetype(struct archive_entry *entry)
+  {
+  	return (AE_IFMT & entry->acl.mode);
+-@@ -520,7 +520,7 @@ archive_entry_ino64(struct archive_entry
 +@@ -525,7 +525,7 @@ archive_entry_ino64(struct archive_entry *entry)
-+ 	return (entry->ae_stat.aest_ino);
-+ }
-+ 
-+-mode_t
-++__LA_MODE_T
-+ archive_entry_mode(struct archive_entry *entry)
-+ {
-+ 	return (entry->acl.mode);
+  	return (entry->ae_stat.aest_ino);
+  }
+  
+@@ -18,7 +29,7 @@
+  archive_entry_mode(struct archive_entry *entry)
+  {
+  	return (entry->acl.mode);
+-@@ -593,7 +593,7 @@ _archive_entry_pathname_l(struct archive
 +@@ -598,7 +598,7 @@ _archive_entry_pathname_l(struct archive_entry *entry,
-+ 	return (archive_mstring_get_mbs_l(&entry->ae_pathname, p, len, sc));
-+ }
-+ 
-+-mode_t
-++__LA_MODE_T
-+ archive_entry_perm(struct archive_entry *entry)
-+ {
-+ 	return (~AE_IFMT & entry->acl.mode);
+  	return (archive_mstring_get_mbs_l(&entry->ae_pathname, p, len, sc));
+  }
+  
+@@ -27,3 +38,6 @@
+  archive_entry_perm(struct archive_entry *entry)
+  {
+  	return (~AE_IFMT & entry->acl.mode);
 +-- 
 +2.26.0.windows.1
 +
-diff --git a/contrib/src/libarchive/rules.mak b/contrib/src/libarchive/rules.mak
-index 7c2aa6e9be..664c8b59b6 100644
---- a/contrib/src/libarchive/rules.mak
-+++ b/contrib/src/libarchive/rules.mak
-@@ -17,6 +17,7 @@ $(TARBALLS)/libarchive-$(LIBARCHIVE_VERSION).tar.gz:
- libarchive: libarchive-$(LIBARCHIVE_VERSION).tar.gz .sum-libarchive
- 	$(UNPACK)
- 	$(APPLY) $(SRC)/libarchive/0001-Fix-build-failure-without-STATVFS.patch
-+	$(APPLY) $(SRC)/libarchive/0002-archive_entry-use-the-proper-define-for-mode_t.patch
- ifdef HAVE_ANDROID
- 	$(APPLY) $(SRC)/libarchive/android.patch
- endif
 -- 
 2.26.0.windows.1
 
diff --git a/libvlc/patches/0022-contrib-libarchive-Fix-winrt-build.patch b/libvlc/patches/0022-contrib-libarchive-Fix-winrt-build.patch
index 50c2d4e22..2840cb164 100644
--- a/libvlc/patches/0022-contrib-libarchive-Fix-winrt-build.patch
+++ b/libvlc/patches/0022-contrib-libarchive-Fix-winrt-build.patch
@@ -1,7 +1,7 @@
-From aa1e1e4cb5beaddeffa48063be2ff8672d30d0e2 Mon Sep 17 00:00:00 2001
+From c212639ac5492bf1d4b1bbcb1c4d9808f51b5e3c Mon Sep 17 00:00:00 2001
 From: Steve Lhomme <robux4@ycbcr.xyz>
 Date: Mon, 9 Apr 2018 09:59:27 +0200
-Subject: [PATCH 22/28] contrib: libarchive: Fix winrt build
+Subject: [PATCH 22/30] contrib: libarchive: Fix winrt build
 
 don't force compilation for Windows XP
 don't call DebugBreak() (in debug builds)
diff --git a/libvlc/patches/0023-contribs-Fix-ffmpeg-build-with-gcrypt.h.patch b/libvlc/patches/0023-contribs-Fix-ffmpeg-build-with-gcrypt.h.patch
index 10b927b3a..a6a562d13 100644
--- a/libvlc/patches/0023-contribs-Fix-ffmpeg-build-with-gcrypt.h.patch
+++ b/libvlc/patches/0023-contribs-Fix-ffmpeg-build-with-gcrypt.h.patch
@@ -1,7 +1,7 @@
-From b083d0437ce588506df4298ce59640b863048af5 Mon Sep 17 00:00:00 2001
+From 58a13bea9e2ba9da712a660cc07c3283d0466f64 Mon Sep 17 00:00:00 2001
 From: =?UTF-8?q?Hugo=20Beauz=C3=A9e-Luyssen?= <hugo@beauzee.fr>
 Date: Mon, 9 Apr 2018 13:04:02 +0200
-Subject: [PATCH 23/28] contribs: Fix ffmpeg build with gcrypt.h
+Subject: [PATCH 23/30] contribs: Fix ffmpeg build with gcrypt.h
 
 ---
  contrib/src/ffmpeg/ffmpeg-win32-bcrypt.patch | 12 ++++++++++++
diff --git a/libvlc/patches/0024-contribs-Fix-gnutls-UWP-build-with-mingw-w64.patch b/libvlc/patches/0024-contribs-Fix-gnutls-UWP-build-with-mingw-w64.patch
index 48d082f7a..aabc8fd45 100644
--- a/libvlc/patches/0024-contribs-Fix-gnutls-UWP-build-with-mingw-w64.patch
+++ b/libvlc/patches/0024-contribs-Fix-gnutls-UWP-build-with-mingw-w64.patch
@@ -1,7 +1,7 @@
-From 10dd06204e508180d083d8c7325e2503bf864936 Mon Sep 17 00:00:00 2001
+From 1e75b272cc855c5e5fc96724100e5c33ee59bb3e Mon Sep 17 00:00:00 2001
 From: =?UTF-8?q?Hugo=20Beauz=C3=A9e-Luyssen?= <hugo@beauzee.fr>
 Date: Mon, 9 Apr 2018 13:25:00 +0200
-Subject: [PATCH 24/28] contribs: Fix gnutls UWP build with mingw-w64
+Subject: [PATCH 24/30] contribs: Fix gnutls UWP build with mingw-w64
 
 ---
  contrib/src/gnutls/winstore.patch | 20 ++++++++++++++++++++
diff --git a/libvlc/patches/0025-win32-fix-crash-on-closesocket-when-a-poll-is-pendin.patch b/libvlc/patches/0025-win32-fix-crash-on-closesocket-when-a-poll-is-pendin.patch
index a4116f8fb..acdb2262f 100644
--- a/libvlc/patches/0025-win32-fix-crash-on-closesocket-when-a-poll-is-pendin.patch
+++ b/libvlc/patches/0025-win32-fix-crash-on-closesocket-when-a-poll-is-pendin.patch
@@ -1,7 +1,7 @@
-From 97a9d1a66f246e8036025f0754a2443c72dea17c Mon Sep 17 00:00:00 2001
+From 6724d01f7c75b5d458a97e62c911f6bebc977dd9 Mon Sep 17 00:00:00 2001
 From: Steve Lhomme <robux4@ycbcr.xyz>
 Date: Mon, 9 Apr 2018 18:46:34 +0200
-Subject: [PATCH 25/28] win32: fix crash on closesocket() when a poll() is
+Subject: [PATCH 25/30] win32: fix crash on closesocket() when a poll() is
  pending
 
 Only for winstore builds for now
diff --git a/libvlc/patches/0026-contrib-ffmpeg-Don-t-check-for-wincrypt-anymore.patch b/libvlc/patches/0026-contrib-ffmpeg-Don-t-check-for-wincrypt-anymore.patch
index 0a0bc1926..7b7115166 100644
--- a/libvlc/patches/0026-contrib-ffmpeg-Don-t-check-for-wincrypt-anymore.patch
+++ b/libvlc/patches/0026-contrib-ffmpeg-Don-t-check-for-wincrypt-anymore.patch
@@ -1,7 +1,7 @@
-From 7191293f56c0c5e7b5606edcd164f30f2a8c07fa Mon Sep 17 00:00:00 2001
+From a683985662118839f71580287b595e0638d1eabd Mon Sep 17 00:00:00 2001
 From: =?UTF-8?q?Hugo=20Beauz=C3=A9e-Luyssen?= <hugo@beauzee.fr>
 Date: Tue, 10 Apr 2018 15:14:25 +0200
-Subject: [PATCH 26/28] contrib: ffmpeg: Don't check for wincrypt anymore
+Subject: [PATCH 26/30] contrib: ffmpeg: Don't check for wincrypt anymore
 
 ---
  .../src/ffmpeg/ffmpeg-winrt-wincrypt.patch    | 27 +++++++++++++++++++
diff --git a/libvlc/patches/0027-contrib-gnutls-Use-winstorecompat-overload-when-avai.patch b/libvlc/patches/0027-contrib-gnutls-Use-winstorecompat-overload-when-avai.patch
index b96878fe7..637640d68 100644
--- a/libvlc/patches/0027-contrib-gnutls-Use-winstorecompat-overload-when-avai.patch
+++ b/libvlc/patches/0027-contrib-gnutls-Use-winstorecompat-overload-when-avai.patch
@@ -1,7 +1,7 @@
-From 80b2cefbe907a6365ca6329f2107fdc19a012095 Mon Sep 17 00:00:00 2001
+From bee07f4d02d4c2579edb864cfe0befce0d290869 Mon Sep 17 00:00:00 2001
 From: =?UTF-8?q?Hugo=20Beauz=C3=A9e-Luyssen?= <hugo@beauzee.fr>
 Date: Tue, 10 Apr 2018 15:58:44 +0200
-Subject: [PATCH 27/28] contrib: gnutls: Use winstorecompat overload when
+Subject: [PATCH 27/30] contrib: gnutls: Use winstorecompat overload when
  available
 
 ---
diff --git a/libvlc/patches/0028-contrib-mpg123-Simplify-unicode-checks.patch b/libvlc/patches/0028-contrib-mpg123-Simplify-unicode-checks.patch
index 845d465e3..945ec97fc 100644
--- a/libvlc/patches/0028-contrib-mpg123-Simplify-unicode-checks.patch
+++ b/libvlc/patches/0028-contrib-mpg123-Simplify-unicode-checks.patch
@@ -1,7 +1,7 @@
-From b29fc4a911a926d8da2f9e4b062cad4d68344c50 Mon Sep 17 00:00:00 2001
+From dd317a9549ca41b63f07e4f607aadc0999eb8563 Mon Sep 17 00:00:00 2001
 From: =?UTF-8?q?Hugo=20Beauz=C3=A9e-Luyssen?= <hugo@beauzee.fr>
 Date: Tue, 10 Apr 2018 17:14:15 +0200
-Subject: [PATCH 28/28] contrib: mpg123: Simplify unicode checks
+Subject: [PATCH 28/30] contrib: mpg123: Simplify unicode checks
 
 ---
  contrib/src/mpg123/winstore.patch | 46 +++++++++++++++++++++++++++++++
diff --git a/libvlc/patches/0029-contrib-libarchive-fix-winrt-patches.patch b/libvlc/patches/0029-contrib-libarchive-fix-winrt-patches.patch
new file mode 100644
index 000000000..034da64b5
--- /dev/null
+++ b/libvlc/patches/0029-contrib-libarchive-fix-winrt-patches.patch
@@ -0,0 +1,31 @@
+From eb2116c04c16ff81f40a7ca4f4027b90c9cdda57 Mon Sep 17 00:00:00 2001
+From: Steve Lhomme <robux4@ycbcr.xyz>
+Date: Thu, 2 Apr 2020 14:58:53 +0200
+Subject: [PATCH 29/30] contrib: libarchive: fix winrt patches
+
+---
+ contrib/src/libarchive/no-windows-files.patch | 11 -----------
+ 1 file changed, 11 deletions(-)
+
+diff --git a/contrib/src/libarchive/no-windows-files.patch b/contrib/src/libarchive/no-windows-files.patch
+index e5300aaef0..aa6ec78536 100644
+--- a/contrib/src/libarchive/no-windows-files.patch
++++ b/contrib/src/libarchive/no-windows-files.patch
+@@ -8,14 +8,3 @@
+  AM_CONDITIONAL([INC_WINDOWS_FILES], [test $inc_windows_files = yes])
+  AM_CONDITIONAL([INC_CYGWIN_FILES], [test $inc_cygwin_files = yes])
+  
+---- libarchive/libarchive/archive_entry.h.old	2017-06-06 16:19:37.998058703 +0200
+-+++ libarchive/libarchive/archive_entry.h	2017-06-06 16:19:41.830066940 +0200
+-@@ -294,7 +294,7 @@
+-
+- __LA_DECL void	archive_entry_set_atime(struct archive_entry *, time_t, long);
+- __LA_DECL void  archive_entry_unset_atime(struct archive_entry *);
+--#if defined(_WIN32) && !defined(__CYGWIN__)
+-+#if defined(_WIN32) && !defined(__CYGWIN__) && WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
+- __LA_DECL void archive_entry_copy_bhfi(struct archive_entry *, BY_HANDLE_FILE_INFORMATION *);
+- #endif
+- __LA_DECL void	archive_entry_set_birthtime(struct archive_entry *, time_t, long);
+-- 
+2.26.0.windows.1
+
diff --git a/libvlc/patches/0030-libarchive-don-t-force-the-Windows-version-to-target.patch b/libvlc/patches/0030-libarchive-don-t-force-the-Windows-version-to-target.patch
new file mode 100644
index 000000000..9503481dc
--- /dev/null
+++ b/libvlc/patches/0030-libarchive-don-t-force-the-Windows-version-to-target.patch
@@ -0,0 +1,77 @@
+From 048e2f6705cd3a74fc58df441e1a62a9dc073821 Mon Sep 17 00:00:00 2001
+From: Steve Lhomme <robux4@ycbcr.xyz>
+Date: Thu, 2 Apr 2020 15:37:54 +0200
+Subject: [PATCH 30/30] libarchive: don't force the Windows version to target
+
+We may want to build for Win10/UWP via the command-line.
+---
+ ...ows-versions-if-they-are-set-in-the-.patch | 44 +++++++++++++++++++
+ contrib/src/libarchive/rules.mak              |  1 +
+ 2 files changed, 45 insertions(+)
+ create mode 100644 contrib/src/libarchive/0005-don-t-force-windows-versions-if-they-are-set-in-the-.patch
+
+diff --git a/contrib/src/libarchive/0005-don-t-force-windows-versions-if-they-are-set-in-the-.patch b/contrib/src/libarchive/0005-don-t-force-windows-versions-if-they-are-set-in-the-.patch
+new file mode 100644
+index 0000000000..37af69a79a
+--- /dev/null
++++ b/contrib/src/libarchive/0005-don-t-force-windows-versions-if-they-are-set-in-the-.patch
+@@ -0,0 +1,44 @@
++From a4fa6bef8bdb141d629d79d8d1f3e67448bd67e1 Mon Sep 17 00:00:00 2001
++From: Steve Lhomme <robux4@ycbcr.xyz>
++Date: Thu, 2 Apr 2020 15:33:40 +0200
++Subject: [PATCH 5/5] don't force windows versions if they are set in the
++ environment
++
++---
++ configure.ac | 20 +++++++++++++++++---
++ 1 file changed, 17 insertions(+), 3 deletions(-)
++
++diff --git a/configure.ac b/configure.ac
++index 7312c4d5..05ca4955 100644
++--- a/configure.ac
+++++ b/configure.ac
++@@ -244,9 +244,23 @@ AM_CONDITIONAL([STATIC_BSDCPIO], [ test "$static_bsdcpio" = yes ])
++ # Set up defines needed before including any headers
++ case $host in
++   *mingw* | *cygwin* | *msys*  )
++-  AC_DEFINE([_WIN32_WINNT], 0x0502, [Define to '0x0502' for Windows Server 2003 APIs.])
++-  AC_DEFINE([WINVER], 0x0502, [Define to '0x0502' for Windows Server 2003 APIs.])
++-  AC_DEFINE([NTDDI_VERSION], 0x05020000, [Define to '0x05020000' for Windows Server 2003 APIs.])
+++  AC_PREPROC_IFELSE([AC_LANG_PROGRAM(
+++    [[#ifdef _WIN32_WINNT
+++     # error _WIN32_WINNT already defined
+++     #endif
+++    ]],[[;]])
+++  ],[
+++    AC_DEFINE([_WIN32_WINNT], 0x0502, [Define to '0x0502' for Windows Server 2003 APIs.])
+++    AC_DEFINE([NTDDI_VERSION], 0x05020000, [Define to '0x05020000' for Windows Server 2003 APIs.])
+++  ])
+++  AC_PREPROC_IFELSE([AC_LANG_PROGRAM(
+++    [[#ifdef WINVER
+++     # error WINVER already defined
+++     #endif
+++    ]],[[;]])
+++  ],[
+++    AC_DEFINE([WINVER], 0x0502, [Define to '0x0502' for Windows Server 2003 APIs.])
+++  ])
++   ;;
++ esac
++ 
++-- 
++2.26.0.windows.1
++
+diff --git a/contrib/src/libarchive/rules.mak b/contrib/src/libarchive/rules.mak
+index 7c2aa6e9be..bda5298a1a 100644
+--- a/contrib/src/libarchive/rules.mak
++++ b/contrib/src/libarchive/rules.mak
+@@ -26,6 +26,7 @@ ifdef HAVE_WINSTORE
+ 	$(APPLY) $(SRC)/libarchive/winrt.patch
+ endif
+ 	$(APPLY) $(SRC)/libarchive/fix-types.patch
++	$(APPLY) $(SRC)/libarchive/0005-don-t-force-windows-versions-if-they-are-set-in-the-.patch
+ 	$(call pkg_static,"build/pkgconfig/libarchive.pc.in")
+ 	$(MOVE)
+ 
+-- 
+2.26.0.windows.1
+
-- 
GitLab