[vlc-devel] [PATCH] contrib: update to flac 1.3.3

Tristan Matthews tmatth at videolan.org
Mon Aug 26 21:09:48 CEST 2019


On Mon, Aug 26, 2019 at 11:35 AM Tristan Matthews <tmatth at videolan.org> wrote:
>
> ---
>  contrib/src/flac/SHA512SUMS                   |  2 +-
>  .../src/flac/dont-force-msvcrt-version.patch  |  9 ++-
>  contrib/src/flac/no-createfilea.patch         | 55 ++++++++++++++++---
>  ...remove_blocking_code_useless_flaclib.patch | 12 ++--
>  contrib/src/flac/rules.mak                    |  2 +-
>  5 files changed, 58 insertions(+), 22 deletions(-)
>
> diff --git a/contrib/src/flac/SHA512SUMS b/contrib/src/flac/SHA512SUMS
> index 24b75c704c..6c1f8b2d6d 100644
> --- a/contrib/src/flac/SHA512SUMS
> +++ b/contrib/src/flac/SHA512SUMS
> @@ -1 +1 @@
> -63910e8ebbe508316d446ffc9eb6d02efbd5f47d29d2ea7864da9371843c8e671854db6e89ba043fe08aef1845b8ece70db80f1cce853f591ca30d56ef7c3a15  flac-1.3.2.tar.xz
> +d6417e14fab0c41b2df369e5e39ce62a5f588e491af4d465b0162f74e171e5549b2f061867f344bfbf8aaccd246bf5f2acd697e532a2c7901c920c69429b1a28  flac-1.3.3.tar.xz
> diff --git a/contrib/src/flac/dont-force-msvcrt-version.patch b/contrib/src/flac/dont-force-msvcrt-version.patch
> index b233bd3b61..d473347c07 100644
> --- a/contrib/src/flac/dont-force-msvcrt-version.patch
> +++ b/contrib/src/flac/dont-force-msvcrt-version.patch
> @@ -1,10 +1,9 @@
> -diff -urN flac-orig/configure.ac flac/configure.ac
> ---- flac-orig/configure.ac     2017-01-01 03:46:35.224989057 +0200
> -+++ flac/configure.ac  2018-02-26 00:37:22.876134887 +0200
> -@@ -178,7 +178,6 @@
> +--- flac-orig/configure.ac     2019-08-26 11:13:17.604801738 -0400
> ++++ flac/configure.ac  2019-08-26 11:13:46.624689160 -0400
> +@@ -208,7 +208,6 @@
>   os_is_windows=no
>   case "$host" in
> -       *-*-cygwin|*mingw*)
> +       *mingw*)
>  -              CPPFLAGS="-D__MSVCRT_VERSION__=0x0601 $CPPFLAGS"
>                 os_is_windows=yes
>                 ;;
> diff --git a/contrib/src/flac/no-createfilea.patch b/contrib/src/flac/no-createfilea.patch
> index 4cefa2cbb1..b66f96d8e8 100644
> --- a/contrib/src/flac/no-createfilea.patch
> +++ b/contrib/src/flac/no-createfilea.patch
> @@ -1,17 +1,20 @@
> ---- flac/src/libFLAC/windows_unicode_filenames.c.orig  2017-01-05 16:36:45.696358168 +0100
> -+++ flac/src/libFLAC/windows_unicode_filenames.c       2017-01-05 17:03:41.052478210 +0100
> -@@ -35,6 +35,7 @@
> +--- flac-orig/src/share/win_utf8_io/win_utf8_io.c      2019-08-26 11:13:17.600801754 -0400
> ++++ flac/src/share/win_utf8_io/win_utf8_io.c   2019-08-26 11:20:27.895132487 -0400
> +@@ -34,8 +34,10 @@
> + #endif
>
> - #include <io.h>
> + #include <windows.h>
> ++#include <winapifamily.h>
> + #include "share/win_utf8_io.h"
>   #include "share/windows_unicode_filenames.h"
>  +#include <winapifamily.h>
>
> - /* convert UTF-8 back to WCHAR. Caller is responsible for freeing memory */
> - static wchar_t *wchar_from_utf8(const char *str)
> -@@ -186,7 +187,11 @@
> - HANDLE WINAPI flac_internal_CreateFile_utf8(const char *lpFileName, DWORD dwDesiredAccess, DWORD dwShareMode, LPSECURITY_ATTRIBUTES lpSecurityAttributes, DWORD dwCreationDisposition, DWORD dwFlagsAndAttributes, HANDLE hTemplateFile)
> + #define UTF8_BUFFER_SIZE 32768
> +
> +@@ -153,7 +155,11 @@
> + HANDLE WINAPI CreateFile_utf8(const char *lpFileName, DWORD dwDesiredAccess, DWORD dwShareMode, LPSECURITY_ATTRIBUTES lpSecurityAttributes, DWORD dwCreationDisposition, DWORD dwFlagsAndAttributes, HANDLE hTemplateFile)
>   {
> -       if (!utf8_filenames) {
> +       if (!flac_internal_get_utf8_filenames()) {
>  +#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
>                 return CreateFileA(lpFileName, dwDesiredAccess, dwShareMode, lpSecurityAttributes, dwCreationDisposition, dwFlagsAndAttributes, hTemplateFile);
>  +#else
> @@ -20,3 +23,37 @@
>         } else {
>                 wchar_t *wname;
>                 HANDLE handle = INVALID_HANDLE_VALUE;
> +@@ -182,11 +188,13 @@
> + int win_get_console_width(void)
> + {
> +       int width = 80;
> ++#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
> +       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
> +       return width;
> + }
> +
> +@@ -194,6 +202,11 @@
> +
> + static int wprint_console(FILE *stream, const wchar_t *text, size_t len)
> + {
> ++#if !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
> ++      (void)stream;
> ++      OutputDebugStringW(text);
> ++      return len;
> ++#else
> +       DWORD out;
> +       int ret;
> +
> +@@ -220,6 +233,7 @@
> +       if (ret < 0)
> +               return ret;
> +       return len;
> ++#endif
> + }
> +
> + int printf_utf8(const char *format, ...)
> diff --git a/contrib/src/flac/remove_blocking_code_useless_flaclib.patch b/contrib/src/flac/remove_blocking_code_useless_flaclib.patch
> index 620773a0eb..6a302756ed 100644
> --- a/contrib/src/flac/remove_blocking_code_useless_flaclib.patch
> +++ b/contrib/src/flac/remove_blocking_code_useless_flaclib.patch
> @@ -1,11 +1,11 @@
> ---- flac/src/share/grabbag/file.c.orig 2014-11-27 02:19:47.048799991 +0100
> -+++ flac/src/share/grabbag/file.c      2016-05-13 16:32:33.727811662 +0200
> -@@ -117,34 +117,7 @@
> +--- flac-orig/src/share/grabbag/file.c 2019-08-26 11:13:17.600801754 -0400
> ++++ flac/src/share/grabbag/file.c      2019-08-26 11:27:16.801546222 -0400
> +@@ -118,34 +118,7 @@
>   FLAC__bool grabbag__file_are_same(const char *f1, const char *f2)
>   {
> - #if defined _MSC_VER || defined __MINGW32__
> + #if defined _WIN32 && !defined __CYGWIN__
>  -      /* see
> --       * http://www.hydrogenaudio.org/forums/index.php?showtopic=49439&pid=444300&st=0
> +-       *  http://www.hydrogenaudio.org/forums/index.php?showtopic=49439&pid=444300&st=0
>  -       *  http://msdn.microsoft.com/library/default.asp?url=/library/en-us/fileio/fs/getfileinformationbyhandle.asp
>  -       *  http://msdn.microsoft.com/library/default.asp?url=/library/en-us/fileio/fs/by_handle_file_information_str.asp
>  -       *  http://msdn.microsoft.com/library/default.asp?url=/library/en-us/fileio/fs/createfile.asp
> @@ -32,7 +32,7 @@
>  -      if(h2 != INVALID_HANDLE_VALUE)
>  -              CloseHandle(h2);
>  -      return same;
> -+    return true;
> ++      return true;
>   #else
>         struct flac_stat_s s1, s2;
>         return f1 && f2 && flac_stat(f1, &s1) == 0 && flac_stat(f2, &s2) == 0 && s1.st_ino == s2.st_ino && s1.st_dev == s2.st_dev;
> diff --git a/contrib/src/flac/rules.mak b/contrib/src/flac/rules.mak
> index 878e37f5c7..6da2e0ebce 100644
> --- a/contrib/src/flac/rules.mak
> +++ b/contrib/src/flac/rules.mak
> @@ -1,6 +1,6 @@
>  # FLAC
>
> -FLAC_VERSION := 1.3.2
> +FLAC_VERSION := 1.3.3
>  FLAC_URL := http://downloads.xiph.org/releases/flac/flac-$(FLAC_VERSION).tar.xz
>
>  PKGS += flac
> --
> 2.20.1
>

I've only tested that the updated patches apply, I couldn't say if
they are behaving as expected on windows.

-t


More information about the vlc-devel mailing list