[vlc-commits] [Git][videolan/vlc][master] contrib: flac: update to 1.5.0
Tristan Matthews (@tmatth)
gitlab at videolan.org
Sun May 4 20:57:53 UTC 2025
Tristan Matthews pushed to branch master at VideoLAN / VLC
Commits:
669e53c9 by Tristan Matthews at 2025-05-04T18:51:31+00:00
contrib: flac: update to 1.5.0
"This release finally makes the encoder multithreaded! Furthermore, the decoder can now handle chained Ogg FLAC files. As always, a lot of things have been fixed and improved."
The relevant patches have been upstreamed and the microbench tool has been dropped.
- - - - -
5 changed files:
- − contrib/src/flac/0001-Fixed-compilation-of-get_utf8_argv-for-Windows-UWP.patch
- − contrib/src/flac/0001-include-share-compat.h-use-fseek-if-fseeko-is-not-av.patch
- − contrib/src/flac/0002-CMake-disable-fseeko-on-32-bit-Android-before-API-24.patch
- contrib/src/flac/SHA512SUMS
- contrib/src/flac/rules.mak
Changes:
=====================================
contrib/src/flac/0001-Fixed-compilation-of-get_utf8_argv-for-Windows-UWP.patch deleted
=====================================
@@ -1,148 +0,0 @@
-From fd842b6a3bacac9e47504ca4d4fb611fab014fa2 Mon Sep 17 00:00:00 2001
-From: DK <dmitrykos at neutroncode.com>
-Date: Tue, 9 May 2023 15:37:57 +0300
-Subject: [PATCH] Fixed compilation of get_utf8_argv() for Windows UWP
-
-Fixed compilation in Win32 environment.
-Use FLAC_WINDOWS_APP define to check between UWP app and Win32 for more consistency.
----
- src/share/win_utf8_io/win_utf8_io.c | 41 ++++++++++++++++++++---------
- 1 file changed, 28 insertions(+), 13 deletions(-)
-
-diff --git a/src/share/win_utf8_io/win_utf8_io.c b/src/share/win_utf8_io/win_utf8_io.c
-index 65b56997..18921748 100644
---- a/src/share/win_utf8_io/win_utf8_io.c
-+++ b/src/share/win_utf8_io/win_utf8_io.c
-@@ -39,9 +39,12 @@
-
- #define UTF8_BUFFER_SIZE 32768
-
--#if !defined(WINAPI_FAMILY_PARTITION)
--#define WINAPI_FAMILY_PARTITION(x) x
--#define WINAPI_PARTITION_DESKTOP 1
-+/* detect whether it is Windows APP (UWP) or standard Win32 envionment */
-+#if defined(WINAPI_FAMILY_PARTITION) &&\
-+ WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP) && !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
-+ #define FLAC_WINDOWS_APP 1
-+#else
-+ #define FLAC_WINDOWS_APP 0
- #endif
-
- static int local_vsnprintf(char *str, size_t size, const char *fmt, va_list va)
-@@ -106,15 +109,22 @@ static wchar_t *wchar_from_utf8(const char *str)
- /* retrieve WCHAR commandline, expand wildcards and convert everything to UTF-8 */
- int get_utf8_argv(int *argc, char ***argv)
- {
-+#if !FLAC_WINDOWS_APP
- typedef int (__cdecl *wgetmainargs_t)(int*, wchar_t***, wchar_t***, int, int*);
- wgetmainargs_t wgetmainargs;
- HMODULE handle;
-+#endif // !FLAC_WINDOWS_APP
- int wargc;
- wchar_t **wargv;
- wchar_t **wenv;
- char **utf8argv;
- int ret, i;
-
-+#if FLAC_WINDOWS_APP
-+ wargc = __argc;
-+ wargv = __wargv;
-+ wenv = _wenviron;
-+#else // !FLAC_WINDOWS_APP
- if ((handle = LoadLibraryW(L"msvcrt.dll")) == NULL) return 1;
- if ((wgetmainargs = (wgetmainargs_t)GetProcAddress(handle, "__wgetmainargs")) == NULL) {
- FreeLibrary(handle);
-@@ -126,8 +136,11 @@ int get_utf8_argv(int *argc, char ***argv)
- FreeLibrary(handle);
- return 1;
- }
-+#endif // !FLAC_WINDOWS_APP
- if ((utf8argv = (char **)calloc(wargc, sizeof(char*))) == NULL) {
-+ #if !FLAC_WINDOWS_APP
- FreeLibrary(handle);
-+ #endif // !FLAC_WINDOWS_APP
- return 1;
- }
-
-@@ -139,7 +152,9 @@ int get_utf8_argv(int *argc, char ***argv)
- }
- }
-
-+#if !FLAC_WINDOWS_APP
- FreeLibrary(handle); /* do not free it when wargv or wenv are still in use */
-+#endif // !FLAC_WINDOWS_APP
-
- if (ret == 0) {
- *argc = wargc;
-@@ -160,9 +175,9 @@ HANDLE WINAPI CreateFile_utf8(const char *lpFileName, DWORD dwDesiredAccess, DWO
- HANDLE handle = INVALID_HANDLE_VALUE;
-
- if ((wname = wchar_from_utf8(lpFileName)) != NULL) {
--#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
-+#if !FLAC_WINDOWS_APP
- handle = CreateFileW(wname, dwDesiredAccess, dwShareMode, lpSecurityAttributes, dwCreationDisposition, dwFlagsAndAttributes, hTemplateFile);
--#else // !WINAPI_PARTITION_DESKTOP
-+#else // FLAC_WINDOWS_APP
- CREATEFILE2_EXTENDED_PARAMETERS params;
- params.dwSize = sizeof(params);
- params.dwFileAttributes = dwFlagsAndAttributes & 0xFFFF;
-@@ -171,7 +186,7 @@ HANDLE WINAPI CreateFile_utf8(const char *lpFileName, DWORD dwDesiredAccess, DWO
- params.lpSecurityAttributes = lpSecurityAttributes;
- params.hTemplateFile = hTemplateFile;
- handle = CreateFile2(wname, dwDesiredAccess, dwShareMode, dwCreationDisposition, ¶ms);
--#endif // !WINAPI_PARTITION_DESKTOP
-+#endif // FLAC_WINDOWS_APP
- free(wname);
- }
-
-@@ -193,19 +208,19 @@ size_t strlen_utf8(const char *str)
- int win_get_console_width(void)
- {
- int width = 80;
--#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
-+#if !FLAC_WINDOWS_APP
- CONSOLE_SCREEN_BUFFER_INFO csbi;
- HANDLE hOut = GetStdHandle(STD_OUTPUT_HANDLE);
- if(hOut != INVALID_HANDLE_VALUE && hOut != NULL)
- if (GetConsoleScreenBufferInfo(hOut, &csbi) != 0)
- width = csbi.dwSize.X;
--#endif // WINAPI_PARTITION_DESKTOP
-+#endif // !FLAC_WINDOWS_APP
- return width;
- }
-
- /* print functions */
-
--#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
-+#if !FLAC_WINDOWS_APP
- static int wprint_console(FILE *stream, const wchar_t *text, size_t len)
- {
- DWORD out;
-@@ -235,7 +250,7 @@ static int wprint_console(FILE *stream, const wchar_t *text, size_t len)
- return ret;
- return len;
- }
--#endif // WINAPI_PARTITION_DESKTOP
-+#endif // !FLAC_WINDOWS_APP
-
- int printf_utf8(const char *format, ...)
- {
-@@ -276,12 +291,12 @@ int vfprintf_utf8(FILE *stream, const char *format, va_list argptr)
- ret = -1;
- break;
- }
--#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
-+#if !FLAC_WINDOWS_APP
- ret = wprint_console(stream, wout, wcslen(wout));
--#else // !WINAPI_PARTITION_DESKTOP
-+#else // FLAC_WINDOWS_APP
- OutputDebugStringW(wout);
- ret = 0;
--#endif // !WINAPI_PARTITION_DESKTOP
-+#endif // FLAC_WINDOWS_APP
- } while(0);
-
- free(utmp);
---
-2.37.3.windows.1
-
=====================================
contrib/src/flac/0001-include-share-compat.h-use-fseek-if-fseeko-is-not-av.patch deleted
=====================================
@@ -1,33 +0,0 @@
-From 15c68771d6001f09b68dd1aa14b84058584f7987 Mon Sep 17 00:00:00 2001
-From: Steve Lhomme <robux4 at ycbcr.xyz>
-Date: Mon, 22 Apr 2024 12:01:02 +0200
-Subject: [PATCH 1/2] include/share/compat.h : use fseek if fseeko is not
- available
-
----
- include/share/compat.h | 7 +++++++
- 1 file changed, 7 insertions(+)
-
-diff --git a/include/share/compat.h b/include/share/compat.h
-index 7a865153..6e73b16d 100644
---- a/include/share/compat.h
-+++ b/include/share/compat.h
-@@ -62,8 +62,15 @@
- #endif
- #endif
- #else
-+#ifndef HAVE_FSEEKO
-+#define fseeko fseek
-+#define ftello ftell
-+#define FLAC__off_t long
-+#define FLAC__OFF_T_MAX LONG_MAX
-+#else
- #define FLAC__off_t off_t
- #endif
-+#endif
-
- #ifdef HAVE_INTTYPES_H
- #define __STDC_FORMAT_MACROS
---
-2.37.3.windows.1
-
=====================================
contrib/src/flac/0002-CMake-disable-fseeko-on-32-bit-Android-before-API-24.patch deleted
=====================================
@@ -1,39 +0,0 @@
-From 49708201f82d029d948d31e204213978e955eef0 Mon Sep 17 00:00:00 2001
-From: Steve Lhomme <robux4 at ycbcr.xyz>
-Date: Mon, 22 Apr 2024 12:03:33 +0200
-Subject: [PATCH 2/2] [CMake] disable fseeko on 32-bit Android before API 24
-
-It can be linked in the NDK so check_function_exists detects it. But it's only supporting _FILE_OFFSET_BITS=64
-since Android API 24 [1].
-
-With NDK 26 it's no longer possible to build assuming the API is always available.
-
-[1] https://android.googlesource.com/platform/bionic/+/main/docs/32-bit-abi.md
----
- CMakeLists.txt | 10 +++++++++-
- 1 file changed, 9 insertions(+), 1 deletion(-)
-
-diff --git a/CMakeLists.txt b/CMakeLists.txt
-index 316a8210..15490478 100644
---- a/CMakeLists.txt
-+++ b/CMakeLists.txt
-@@ -119,7 +119,15 @@ else()
- check_include_file("x86intrin.h" FLAC__HAS_X86INTRIN)
- endif()
-
--check_function_exists(fseeko HAVE_FSEEKO)
-+
-+if(ANDROID AND CMAKE_SYSTEM_VERSION VERSION_LESS 24 AND (CMAKE_SYSTEM_PROCESSOR MATCHES "i686" OR CMAKE_SYSTEM_PROCESSOR MATCHES "armv7-a"))
-+ # fseeko/ftello may link, but it's not usable before Android API 24 on 32-bit Android
-+ # https://android.googlesource.com/platform/bionic/+/main/docs/32-bit-abi.md
-+ message(STATUS "Disabling fseeko/ftello for 32-bit Android before API 24")
-+ set(HAVE_FSEEKO 0 CACHE INTERNAL "")
-+else()
-+ check_function_exists(fseeko HAVE_FSEEKO)
-+endif()
-
- check_c_source_compiles("int main() { return __builtin_bswap16 (0) ; }" HAVE_BSWAP16)
- check_c_source_compiles("int main() { return __builtin_bswap32 (0) ; }" HAVE_BSWAP32)
---
-2.37.3.windows.1
-
=====================================
contrib/src/flac/SHA512SUMS
=====================================
@@ -1 +1 @@
-20bdf0990a7432ac765037764bc8733a0d5646866fe6cc6f4868152d2a051c89676e501012ae489c7f87b3aacb45a5b30265afaca164cf0cf53ac058644a74c5 flac-1.4.2.tar.xz
+34c9193b804e990b0828a5759e4d7ef1d1859174262d3b305d03e65285edb35c7f429e8071d9dd2c6da0c16e842b40b439bf215704636ae15dd5886151f0d17a flac-1.5.0.tar.xz
=====================================
contrib/src/flac/rules.mak
=====================================
@@ -1,6 +1,6 @@
# FLAC
-FLAC_VERSION := 1.4.2
+FLAC_VERSION := 1.5.0
FLAC_URL := $(GITHUB)/xiph/flac/releases/download/$(FLAC_VERSION)/flac-$(FLAC_VERSION).tar.xz
PKGS += flac
@@ -15,12 +15,6 @@ $(TARBALLS)/flac-$(FLAC_VERSION).tar.xz:
flac: flac-$(FLAC_VERSION).tar.xz .sum-flac
$(UNPACK)
- $(APPLY) $(SRC)/flac/0001-Fixed-compilation-of-get_utf8_argv-for-Windows-UWP.patch
- # use fseek/ftell on 32-bit Android < 24
- $(APPLY) $(SRC)/flac/0001-include-share-compat.h-use-fseek-if-fseeko-is-not-av.patch
- $(APPLY) $(SRC)/flac/0002-CMake-disable-fseeko-on-32-bit-Android-before-API-24.patch
- # disable building a tool we don't use
- sed -e 's,add_subdirectory("microbench"),#add_subdirectory("microbench"),' -i.orig $(UNPACK_DIR)/CMakeLists.txt
$(call pkg_static,"src/libFLAC/flac.pc.in")
$(MOVE)
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/669e53c997f99d411f7eea2e89d86eea5b523947
--
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/669e53c997f99d411f7eea2e89d86eea5b523947
You're receiving this email because of your account on code.videolan.org.
VideoLAN code repository instance
More information about the vlc-commits
mailing list