[vlc-commits] [Git][videolan/vlc][master] contrib: Bump taglib to 1.12

Hugo Beauzée-Luyssen (@chouquette) gitlab at videolan.org
Tue Nov 23 17:51:39 UTC 2021



Hugo Beauzée-Luyssen pushed to branch master at VideoLAN / VLC


Commits:
c651b10d by Hugo Beauzée-Luyssen at 2021-11-23T16:29:13+00:00
contrib: Bump taglib to 1.12

fix #26309

- - - - -


7 changed files:

- contrib/src/taglib/0001-Implement-ID3v2-readStyle-avoid-worst-case.patch
- − contrib/src/taglib/0001-use-SetFilePointerEx-instead-of-SetFilePointer.patch
- − contrib/src/taglib/0002-use-GetFileInformationByHandleEx-on-newer-builds-of-.patch
- − contrib/src/taglib/0003-don-t-use-CreateFile-in-UWP-builds.patch
- contrib/src/taglib/SHA512SUMS
- contrib/src/taglib/rules.mak
- − contrib/src/taglib/use_resolvers_on_streams.patch


Changes:

=====================================
contrib/src/taglib/0001-Implement-ID3v2-readStyle-avoid-worst-case.patch
=====================================
@@ -1,4 +1,4 @@
-From 94b8f426233e87c0b3783b743ad5e3ed458147b1 Mon Sep 17 00:00:00 2001
+From be17e6084a151c901c3946ec7b37afabc3b84f5f Mon Sep 17 00:00:00 2001
 From: Francois Cartegnie <fcvlcdev at free.fr>
 Date: Tue, 11 Aug 2020 10:53:31 +0200
 Subject: [PATCH] Implement ID3v2 readStyle, avoid worst case
@@ -10,10 +10,10 @@ Subject: [PATCH] Implement ID3v2 readStyle, avoid worst case
  3 files changed, 24 insertions(+), 14 deletions(-)
 
 diff --git a/taglib/mpeg/mpegfile.cpp b/taglib/mpeg/mpegfile.cpp
-index af7253fa..59443027 100644
+index 5f14e49d..30124e0d 100644
 --- a/taglib/mpeg/mpegfile.cpp
 +++ b/taglib/mpeg/mpegfile.cpp
-@@ -80,30 +80,31 @@ public:
+@@ -132,30 +132,31 @@ bool MPEG::File::isSupported(IOStream *stream)
  // public members
  ////////////////////////////////////////////////////////////////////////////////
  
@@ -51,7 +51,7 @@ index af7253fa..59443027 100644
  }
  
  MPEG::File::~File()
-@@ -441,11 +442,11 @@ bool MPEG::File::hasAPETag() const
+@@ -498,11 +499,11 @@ bool MPEG::File::hasAPETag() const
  // private members
  ////////////////////////////////////////////////////////////////////////////////
  
@@ -65,7 +65,7 @@ index af7253fa..59443027 100644
  
    if(d->ID3v2Location >= 0) {
      d->tag.set(ID3v2Index, new ID3v2::Tag(this, d->ID3v2Location, d->ID3v2FrameFactory));
-@@ -478,7 +479,7 @@ void MPEG::File::read(bool readProperties)
+@@ -535,7 +536,7 @@ void MPEG::File::read(bool readProperties)
    ID3v1Tag(true);
  }
  
@@ -74,21 +74,21 @@ index af7253fa..59443027 100644
  {
    if(!isValid())
      return -1;
-@@ -499,6 +500,9 @@ long MPEG::File::findID3v2()
-   if(firstSyncByte(data[0]) && secondSynchByte(data[1]))
-     return -1;
+@@ -558,6 +559,9 @@ long MPEG::File::findID3v2()
+   ByteVector tagHeaderBytes(3, '\0');
+   long position = 0;
  
-+  if(readStyle < Properties::ReadStyle::Accurate)
++  if(readStyle < Properties::Accurate)
 +    return -1;
 +
-   // Look for the entire file, if neither an MEPG frame or ID3v2 tag was found
-   // at the beginning of the file.
-   // We don't care about the inefficiency of the code, since this is a seldom case.
+   while(true) {
+     seek(position);
+     const ByteVector buffer = readBlock(bufferSize());
 diff --git a/taglib/mpeg/mpegfile.h b/taglib/mpeg/mpegfile.h
-index e9e97387..fb04c625 100644
+index 3fcb7272..22a282d9 100644
 --- a/taglib/mpeg/mpegfile.h
 +++ b/taglib/mpeg/mpegfile.h
-@@ -74,7 +74,8 @@ namespace TagLib {
+@@ -76,7 +76,8 @@ namespace TagLib {
         * Constructs an MPEG file from \a file.  If \a readProperties is true the
         * file's audio properties will also be read.
         *
@@ -98,7 +98,7 @@ index e9e97387..fb04c625 100644
         *
         * \deprecated This constructor will be dropped in favor of the one below
         * in a future version.
-@@ -89,7 +90,8 @@ namespace TagLib {
+@@ -91,7 +92,8 @@ namespace TagLib {
         * If this file contains and ID3v2 tag the frames will be created using
         * \a frameFactory.
         *
@@ -108,7 +108,7 @@ index e9e97387..fb04c625 100644
         */
        // BIC: merge with the above constructor
        File(FileName file, ID3v2::FrameFactory *frameFactory,
-@@ -106,7 +108,8 @@ namespace TagLib {
+@@ -108,7 +110,8 @@ namespace TagLib {
         * If this file contains and ID3v2 tag the frames will be created using
         * \a frameFactory.
         *
@@ -118,7 +118,7 @@ index e9e97387..fb04c625 100644
         */
        File(IOStream *stream, ID3v2::FrameFactory *frameFactory,
             bool readProperties = true,
-@@ -374,8 +377,8 @@ namespace TagLib {
+@@ -375,8 +378,8 @@ namespace TagLib {
        File(const File &);
        File &operator=(const File &);
  
@@ -130,11 +130,11 @@ index e9e97387..fb04c625 100644
        class FilePrivate;
        FilePrivate *d;
 diff --git a/taglib/toolkit/taglib.h b/taglib/toolkit/taglib.h
-index bd4886bd..dfabe3d4 100644
+index ffce61f7..38fee5d1 100644
 --- a/taglib/toolkit/taglib.h
 +++ b/taglib/toolkit/taglib.h
-@@ -44,6 +44,9 @@
- #define TAGLIB_CONSTRUCT_BITSET(x) static_cast<unsigned long>(x)
+@@ -54,6 +54,9 @@
+ #define TAGLIB_DEPRECATED
  #endif
  
 +/* VLC Specific patches implementations */
@@ -144,5 +144,5 @@ index bd4886bd..dfabe3d4 100644
  
  //! A namespace for all TagLib related classes and functions
 -- 
-2.25.4
+2.33.0
 


=====================================
contrib/src/taglib/0001-use-SetFilePointerEx-instead-of-SetFilePointer.patch deleted
=====================================
@@ -1,40 +0,0 @@
-From d27cc3568c2c04e86a8ec6e29fcdf7e3814b0596 Mon Sep 17 00:00:00 2001
-From: Steve Lhomme <robux4 at ycbcr.xyz>
-Date: Fri, 15 May 2020 09:25:40 +0200
-Subject: [PATCH 1/3] use SetFilePointerEx instead of SetFilePointer
-
-It's available on more Win10 versions with UCRT builds and provides the same
-features. The API is available since Windows XP.
----
- taglib/toolkit/tfilestream.cpp | 8 ++++++--
- 1 file changed, 6 insertions(+), 2 deletions(-)
-
-diff --git a/taglib/toolkit/tfilestream.cpp b/taglib/toolkit/tfilestream.cpp
-index 5205bae0..4b448271 100644
---- a/taglib/toolkit/tfilestream.cpp
-+++ b/taglib/toolkit/tfilestream.cpp
-@@ -364,7 +364,9 @@ void FileStream::seek(long offset, Position p)
-   }
- 
-   SetLastError(NO_ERROR);
--  SetFilePointer(d->file, offset, NULL, whence);
-+  LARGE_INTEGER lOffset;
-+  lOffset.QuadPart = offset;
-+  SetFilePointerEx(d->file, lOffset, NULL, whence);
- 
-   const int lastError = GetLastError();
-   if(lastError != NO_ERROR && lastError != ERROR_NEGATIVE_SEEK)
-@@ -411,7 +413,9 @@ long FileStream::tell() const
- #ifdef _WIN32
- 
-   SetLastError(NO_ERROR);
--  const DWORD position = SetFilePointer(d->file, 0, NULL, FILE_CURRENT);
-+  LARGE_INTEGER lOffset;
-+  lOffset.QuadPart = 0;
-+  const DWORD position = SetFilePointerEx(d->file, lOffset, NULL, FILE_CURRENT);
-   if(GetLastError() == NO_ERROR) {
-     return static_cast<long>(position);
-   }
--- 
-2.26.0.windows.1
-


=====================================
contrib/src/taglib/0002-use-GetFileInformationByHandleEx-on-newer-builds-of-.patch deleted
=====================================
@@ -1,39 +0,0 @@
-From 9c02a2c245bed1d70dbd80b0e63abbcdecb74761 Mon Sep 17 00:00:00 2001
-From: Steve Lhomme <robux4 at ycbcr.xyz>
-Date: Fri, 15 May 2020 09:29:55 +0200
-Subject: [PATCH 2/3] use GetFileInformationByHandleEx on newer builds of
- Windows
-
-It's available since Vista and UWP builds that don't have GetFileSize.
-
-See https://docs.microsoft.com/en-us/uwp/win32-and-com/win32-apis
----
- taglib/toolkit/tfilestream.cpp | 8 ++++++++
- 1 file changed, 8 insertions(+)
-
-diff --git a/taglib/toolkit/tfilestream.cpp b/taglib/toolkit/tfilestream.cpp
-index 4b448271..ad4443ea 100644
---- a/taglib/toolkit/tfilestream.cpp
-+++ b/taglib/toolkit/tfilestream.cpp
-@@ -441,10 +441,18 @@ long FileStream::length()
- #ifdef _WIN32
- 
-   SetLastError(NO_ERROR);
-+#if _WIN32_WINNT < _WIN32_WINNT_VISTA
-   const DWORD fileSize = GetFileSize(d->file, NULL);
-   if(GetLastError() == NO_ERROR) {
-     return static_cast<long>(fileSize);
-   }
-+#else // _WIN32_WINNT_VISTA
-+  FILE_STANDARD_INFO fStdInfo;
-+  BOOL success = GetFileInformationByHandleEx(d->file, FileStandardInfo, (LPVOID)&fStdInfo, sizeof(FILE_STANDARD_INFO));
-+  if(success) {
-+    return static_cast<long>(fStdInfo.EndOfFile.LowPart);
-+  }
-+#endif // _WIN32_WINNT_VISTA
-   else {
-     debug("FileStream::length() -- Failed to get the file size.");
-     return 0;
--- 
-2.26.0.windows.1
-


=====================================
contrib/src/taglib/0003-don-t-use-CreateFile-in-UWP-builds.patch deleted
=====================================
@@ -1,43 +0,0 @@
-From a9024bd18ce20653616e04702b5e220de56b6b2c Mon Sep 17 00:00:00 2001
-From: Steve Lhomme <robux4 at ycbcr.xyz>
-Date: Fri, 15 May 2020 09:32:21 +0200
-Subject: [PATCH 3/3] don't use CreateFile in UWP builds
-
-CreateFile2 is available for such builds with more internal restrictions..
-
-See https://docs.microsoft.com/en-us/uwp/win32-and-com/win32-apis
-https://docs.microsoft.com/en-us/windows/win32/api/fileapi/nf-fileapi-createfile2
----
- taglib/toolkit/tfilestream.cpp | 13 +++++++++++++
- 1 file changed, 13 insertions(+)
-
-diff --git a/taglib/toolkit/tfilestream.cpp b/taglib/toolkit/tfilestream.cpp
-index ad4443ea..10cd8d56 100644
---- a/taglib/toolkit/tfilestream.cpp
-+++ b/taglib/toolkit/tfilestream.cpp
-@@ -52,9 +52,22 @@ namespace
-     const DWORD access = readOnly ? GENERIC_READ : (GENERIC_READ | GENERIC_WRITE);
- 
-     if(!path.wstr().empty())
-+#if !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
-+    {
-+      CREATEFILE2_EXTENDED_PARAMETERS createExParams;
-+      createExParams.dwSize = sizeof(createExParams);
-+      createExParams.dwFileAttributes = FILE_ATTRIBUTE_NORMAL;
-+      createExParams.dwFileFlags = 0;
-+      createExParams.dwSecurityQosFlags = 0;
-+      createExParams.lpSecurityAttributes = NULL;
-+      createExParams.hTemplateFile = NULL;
-+      return CreateFile2(path.wstr().c_str(), access, FILE_SHARE_READ, OPEN_EXISTING, &createExParams);
-+    }
-+#else // WINAPI_PARTITION_DESKTOP
-       return CreateFileW(path.wstr().c_str(), access, FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, NULL);
-     else if(!path.str().empty())
-       return CreateFileA(path.str().c_str(), access, FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, NULL);
-+#endif // WINAPI_PARTITION_DESKTOP
-     else
-       return InvalidFileHandle;
-   }
--- 
-2.26.0.windows.1
-


=====================================
contrib/src/taglib/SHA512SUMS
=====================================
@@ -1 +1 @@
-7846775c4954ea948fe4383e514ba7c11f55d038ee06b6ea5a0a1c1069044b348026e76b27aa4ba1c71539aa8143e1401fab39184cc6e915ba0ae2c06133cb98  taglib-1.11.1.tar.gz
+7e369faa5e3c6c6401052b7a19e35b0cf8c1e5ed9597053ac731a7718791d5d4803d1b18a93e903ec8c3fc6cb92e34d9616daa2ae4d326965d4c4d5624dcdaba  taglib-1.12.tar.gz


=====================================
contrib/src/taglib/rules.mak
=====================================
@@ -1,6 +1,6 @@
 # TagLib
 
-TAGLIB_VERSION := 1.11.1
+TAGLIB_VERSION := 1.12
 TAGLIB_URL := https://taglib.org/releases/taglib-$(TAGLIB_VERSION).tar.gz
 
 PKGS += taglib
@@ -15,10 +15,6 @@ $(TARBALLS)/taglib-$(TAGLIB_VERSION).tar.gz:
 
 taglib: taglib-$(TAGLIB_VERSION).tar.gz .sum-taglib
 	$(UNPACK)
-	$(APPLY) $(SRC)/taglib/0001-use-SetFilePointerEx-instead-of-SetFilePointer.patch
-	$(APPLY) $(SRC)/taglib/0002-use-GetFileInformationByHandleEx-on-newer-builds-of-.patch
-	$(APPLY) $(SRC)/taglib/0003-don-t-use-CreateFile-in-UWP-builds.patch
-	$(APPLY) $(SRC)/taglib/use_resolvers_on_streams.patch
 	$(APPLY) $(SRC)/taglib/0001-Implement-ID3v2-readStyle-avoid-worst-case.patch
 	$(MOVE)
 


=====================================
contrib/src/taglib/use_resolvers_on_streams.patch deleted
=====================================
@@ -1,44 +0,0 @@
-From e648e07b7ebc4a1254a8673388c8f578fedf62a6 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Hugo=20Beauz=C3=A9e-Luyssen?= <hugo at beauzee.fr>
-Date: Mon, 18 Mar 2019 15:57:28 +0100
-Subject: [PATCH] fileref: Use user defined resolvers with IOStream
-
----
- taglib/fileref.cpp | 14 +++++++-------
- 1 file changed, 7 insertions(+), 7 deletions(-)
-
-diff --git a/taglib/fileref.cpp b/taglib/fileref.cpp
-index 3a7f2c65..b0369a0c 100644
---- a/taglib/fileref.cpp
-+++ b/taglib/fileref.cpp
-@@ -88,13 +88,6 @@ namespace
-     return 0;
-   }
- 
--  template <>
--  File *resolveFileType<IOStream *>(IOStream *arg, bool readProperties,
--                                    AudioProperties::ReadStyle style)
--  {
--    return 0;
--  }
--
-   template <>
-   File *resolveFileType<FileName>(FileName arg, bool readProperties,
-                                   AudioProperties::ReadStyle style)
-@@ -109,6 +102,13 @@ namespace
-     return 0;
-   }
- 
-+  template <>
-+  File *resolveFileType<IOStream *>(IOStream *arg, bool readProperties,
-+                                    AudioProperties::ReadStyle style)
-+  {
-+    return resolveFileType(arg->name(), readProperties, style);
-+  }
-+
-   template <typename T>
-   File* createInternal(T arg, bool readAudioProperties,
-                        AudioProperties::ReadStyle audioPropertiesStyle)
--- 
-2.20.1
-



View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/c651b10d33dc0fb7b9670208f93f94f850ba8ca4

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/c651b10d33dc0fb7b9670208f93f94f850ba8ca4
You're receiving this email because of your account on code.videolan.org.




More information about the vlc-commits mailing list