Skip to content
Snippets Groups Projects
Commit f4a9017d authored by Alaric Senat's avatar Alaric Senat Committed by Felix Paul Kühne
Browse files

contrib: medialibrary: update to 0.12.4

Bugfixes:
- Fix build with gcc >= 13
- Fix CreateFileW usage in winstore builds
- Fix a crash on linux with some external storage devices
parent 04ea9e05
No related branches found
No related tags found
1 merge request!3786contrib: medialibrary: update to 0.12.4
Pipeline #353589 passed with stages
in 40 minutes and 25 seconds
From 8d4514b109976eb33cd848828f29767f28b135ae Mon Sep 17 00:00:00 2001
From: Steve Lhomme <robux4@ycbcr.xyz>
Date: Tue, 23 May 2023 10:08:17 +0200
Subject: [PATCH] LockFile: favor CreateFile2 over CreateFileW
The API is always available in Win8+ even in UWP builds, unlike CreateFileW.
The API is pretty much the same.
---
src/LockFile.cpp | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/src/LockFile.cpp b/src/LockFile.cpp
index 613ff694..acd65502 100644
--- a/src/LockFile.cpp
+++ b/src/LockFile.cpp
@@ -50,7 +50,11 @@ std::unique_ptr<LockFile> LockFile::lock( const std::string& mlFolderPath )
Handle handle;
#ifdef _WIN32
auto wide = charset::ToWide( lockFile.c_str() );
+# if _WIN32_WINNT >= 0x0602 /* _WIN32_WINNT_WIN8 */
+ handle = CreateFile2(wide.get(), GENERIC_WRITE, 0, CREATE_ALWAYS, NULL);
+# else
handle = CreateFileW(wide.get(), GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, 0, NULL);
+# endif
if ( handle == INVALID_HANDLE_VALUE )
{
LOG_ERROR( "Could not open lockfile: ", lockFile );
--
2.37.3.windows.1
aa9e4168cad9cf4b348f834ae85222c65f294f9e8053d7ee138250791857ede356326bda884dc0cfb6a20192d652f73f59996196edd611b33b6638c8f74d101e medialibrary-0.12.3.tar.bz2
2b9e9eb5000fd8ff333d29786c3c8ed9f2e2541cd34652b7087ea0fb6b46bfb354472e20dad7c53c159dd447882427e61233ef6224ad5902bedff37756fd950a medialibrary-0.12.4.tar.bz2
MEDIALIBRARY_VERSION := 0.12.3
MEDIALIBRARY_VERSION := 0.12.4
MEDIALIBRARY_URL := https://code.videolan.org/videolan/medialibrary/-/archive/$(MEDIALIBRARY_VERSION)/medialibrary-$(MEDIALIBRARY_VERSION).tar.bz2
PKGS += medialibrary
......@@ -15,7 +15,6 @@ $(TARBALLS)/medialibrary-$(MEDIALIBRARY_VERSION).tar.bz2:
medialibrary: medialibrary-$(MEDIALIBRARY_VERSION).tar.bz2 .sum-medialibrary
$(UNPACK)
$(APPLY) $(SRC)/medialibrary/0001-LockFile-favor-CreateFile2-over-CreateFileW.patch
$(MOVE)
.medialibrary: medialibrary crossfile.meson
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment