diff --git a/NEWS b/NEWS index 3b9259ad6..5eff13eb2 100644 --- a/NEWS +++ b/NEWS @@ -22,11 +22,15 @@ ver 0.24 (not yet released) * static partition configuration * remove Haiku support -ver 0.23.10 (not yet released) +ver 0.23.10 (2022/10/14) +* storage + - curl: fix file time stamps * decoder - ffmpeg: fix libfmt 9 compiler warning * encoder - flac: fix failure when libFLAC is built without Ogg support +* output + - alsa: fix crash bug * Windows - log to stdout by default, don't require "log_file" setting diff --git a/doc/user.rst b/doc/user.rst index 5bb4ca793..4170808c8 100644 --- a/doc/user.rst +++ b/doc/user.rst @@ -199,7 +199,7 @@ Compiling for Android You need: * Android SDK -* `Android NDK r23 `_ +* `Android NDK r25b `_ * `Meson 0.56.0 `__ and `Ninja `__ * cmake diff --git a/meson.build b/meson.build index 469c77fda..368a461ab 100644 --- a/meson.build +++ b/meson.build @@ -250,6 +250,14 @@ endif fmt_dep = dependency('fmt', fallback: ['fmt', 'fmt_dep']) +if compiler.get_id() == 'clang' and compiler.version().version_compare('<15') + fmt_dep = declare_dependency( + dependencies: fmt_dep, + # suppress bogus clang 14 warning (the version in Android NDK r25b) + compile_args: ['-Wno-unused-local-typedef'], + ) +endif + log = static_library( 'log', 'src/Log.cxx', diff --git a/python/build/libs.py b/python/build/libs.py index 0a502c84a..abe48996b 100644 --- a/python/build/libs.py +++ b/python/build/libs.py @@ -57,8 +57,8 @@ flac = AutotoolsProject( ) zlib = ZlibProject( - 'http://zlib.net/zlib-1.2.12.tar.xz', - '7db46b8d7726232a621befaab4a1c870f00a90805511c0e0090441dac57def18', + 'http://zlib.net/zlib-1.2.13.tar.xz', + 'd14c38e313afc35a9a8760dadf26042f51ea0f5d154b0630a31da0540107fb98', 'lib/libz.a', ) @@ -114,16 +114,20 @@ libmodplug = AutotoolsProject( ) libopenmpt = AutotoolsProject( - 'https://lib.openmpt.org/files/libopenmpt/src/libopenmpt-0.5.12+release.autotools.tar.gz', - '892aea7a599b5d21842bebf463b5aafdad5711be7008dd84401920c6234820af', + 'https://lib.openmpt.org/files/libopenmpt/src/libopenmpt-0.6.6+release.autotools.tar.gz', + '6ddb9e26a430620944891796fefb1bbb38bd9148f6cfc558810c0d3f269876c7', 'lib/libopenmpt.a', [ '--disable-shared', '--enable-static', '--disable-openmpt123', + '--disable-examples', + '--disable-tests', + '--disable-doxygen-doc', '--without-mpg123', '--without-ogg', '--without-vorbis', '--without-vorbisfile', '--without-portaudio', '--without-portaudiocpp', '--without-sndfile', + '--without-flac', ], - base='libopenmpt-0.5.12+release.autotools', + base='libopenmpt-0.6.6+release.autotools', ) wildmidi = CmakeProject( @@ -153,8 +157,8 @@ gme = CmakeProject( ) ffmpeg = FfmpegProject( - 'http://ffmpeg.org/releases/ffmpeg-5.1.tar.xz', - '55eb6aab5ee235550fa54a33eaf8bf1b4ec66c01453182b12f6a993d75698b03', + 'http://ffmpeg.org/releases/ffmpeg-5.1.2.tar.xz', + '619e706d662c8420859832ddc259cd4d4096a48a2ce1eefd052db9e440eef3dc', 'lib/libavcodec.a', [ '--disable-shared', '--enable-static', @@ -389,8 +393,8 @@ openssl = OpenSSLProject( ) curl = CmakeProject( - 'https://curl.se/download/curl-7.84.0.tar.xz', - '2d118b43f547bfe5bae806d8d47b4e596ea5b25a6c1f080aef49fbcd817c5db8', + 'https://curl.se/download/curl-7.85.0.tar.xz', + '88b54a6d4b9a48cb4d873c7056dcba997ddd5b7be5a2d537a4acb55c20b04be6', 'lib/libcurl.a', [ '-DBUILD_CURL_EXE=OFF', @@ -424,8 +428,8 @@ curl = CmakeProject( ) libnfs = AutotoolsProject( - 'https://github.com/sahlberg/libnfs/archive/libnfs-5.0.1.tar.gz', - '7ef445410b42f36b9bad426608b53ccb9ccca4101e545c383f564c11db672ca8', + 'https://github.com/sahlberg/libnfs/archive/libnfs-5.0.2.tar.gz', + '637e56643b19da9fba98f06847788c4dad308b723156a64748041035dcdf9bd3', 'lib/libnfs.a', [ '--disable-shared', '--enable-static', @@ -436,7 +440,7 @@ libnfs = AutotoolsProject( '--disable-utils', '--disable-examples', ], - base='libnfs-libnfs-5.0.1', + base='libnfs-libnfs-5.0.2', autoreconf=True, ) diff --git a/src/android/Context.cxx b/src/android/Context.cxx index 0a31bf58c..7f6cf9993 100644 --- a/src/android/Context.cxx +++ b/src/android/Context.cxx @@ -46,7 +46,7 @@ Context::Initialise(JNIEnv *env) noexcept AllocatedPath Context::GetExternalFilesDir(JNIEnv *env, const char *type) noexcept { - assert(_type != nullptr); + assert(type != nullptr); jobject file = env->CallObjectMethod(Get(), getExternalFilesDir_method, Java::String::Optional(env, type).Get()); diff --git a/src/java/File.cxx b/src/java/File.cxx index 4866953e3..2e50bca9e 100644 --- a/src/java/File.cxx +++ b/src/java/File.cxx @@ -49,9 +49,6 @@ Java::File::Initialise(JNIEnv *env) noexcept AllocatedPath Java::File::ToAbsolutePath(JNIEnv *env, jobject _file) noexcept { - assert(env != nullptr); - assert(_file != nullptr); - LocalObject file(env, _file); const jstring path = GetAbsolutePath(env, file); diff --git a/src/output/plugins/AlsaOutputPlugin.cxx b/src/output/plugins/AlsaOutputPlugin.cxx index c59b469f4..427292c2b 100644 --- a/src/output/plugins/AlsaOutputPlugin.cxx +++ b/src/output/plugins/AlsaOutputPlugin.cxx @@ -810,8 +810,12 @@ AlsaOutput::Open(AudioFormat &audio_format) fmt::format("Failed to open ALSA device \"{}\"", GetDevice()).c_str()); + const char *pcm_name = snd_pcm_name(pcm); + if (pcm_name == nullptr) + pcm_name = "?"; + FmtDebug(alsa_output_domain, "opened {} type={}", - snd_pcm_name(pcm), + pcm_name, snd_pcm_type_name(snd_pcm_type(pcm))); #ifdef ENABLE_DSD diff --git a/src/storage/plugins/CurlStorage.cxx b/src/storage/plugins/CurlStorage.cxx index e4cfe0b8e..393fdfc71 100644 --- a/src/storage/plugins/CurlStorage.cxx +++ b/src/storage/plugins/CurlStorage.cxx @@ -34,7 +34,6 @@ #include "event/InjectEvent.hxx" #include "thread/Mutex.hxx" #include "thread/Cond.hxx" -#include "time/Parser.hxx" #include "util/ASCII.hxx" #include "util/RuntimeError.hxx" #include "util/SpanCast.hxx" @@ -173,8 +172,9 @@ struct DavResponse { } }; +[[gnu::pure]] static unsigned -ParseStatus(const char *s) +ParseStatus(const char *s) noexcept { /* skip the "HTTP/1.1" prefix */ const char *space = std::strchr(s, ' '); @@ -184,37 +184,37 @@ ParseStatus(const char *s) return strtoul(space + 1, nullptr, 10); } +[[gnu::pure]] static unsigned -ParseStatus(const char *s, size_t length) +ParseStatus(const char *s, size_t length) noexcept { return ParseStatus(std::string(s, length).c_str()); } +[[gnu::pure]] static std::chrono::system_clock::time_point -ParseTimeStamp(const char *s) +ParseTimeStamp(const char *s) noexcept { - try { - // TODO: make this more robust - return ParseTimePoint(s, "%a, %d %b %Y %T"); - } catch (...) { - return std::chrono::system_clock::time_point::min(); - } + return std::chrono::system_clock::from_time_t(curl_getdate(s, nullptr)); } +[[gnu::pure]] static std::chrono::system_clock::time_point -ParseTimeStamp(const char *s, size_t length) +ParseTimeStamp(const char *s, size_t length) noexcept { return ParseTimeStamp(std::string(s, length).c_str()); } +[[gnu::pure]] static uint64_t -ParseU64(const char *s) +ParseU64(const char *s) noexcept { return strtoull(s, nullptr, 10); } +[[gnu::pure]] static uint64_t -ParseU64(const char *s, size_t length) +ParseU64(const char *s, size_t length) noexcept { return ParseU64(std::string(s, length).c_str()); } @@ -280,6 +280,7 @@ public: "" "" "" + "" "" ""); } diff --git a/src/time/Parser.cxx b/src/time/Parser.cxx deleted file mode 100644 index 0b9689afd..000000000 --- a/src/time/Parser.cxx +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright 2014-2019 Max Kellermann - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * - Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * - Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the - * distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * FOUNDATION OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - * OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "Parser.hxx" -#include "Convert.hxx" - -#include -#include - -#include - -std::chrono::system_clock::time_point -ParseTimePoint(const char *s, const char *format) -{ - assert(s != nullptr); - assert(format != nullptr); - -#ifdef _WIN32 - /* TODO: emulate strptime()? */ - (void)s; - (void)format; - throw std::runtime_error("Time parsing not implemented on Windows"); -#else - struct tm tm{}; - const char *end = strptime(s, format, &tm); - if (end == nullptr || *end != 0) - throw std::runtime_error("Failed to parse time stamp"); - - return TimeGm(tm); -#endif /* !_WIN32 */ -} diff --git a/src/time/Parser.hxx b/src/time/Parser.hxx deleted file mode 100644 index bf92afa72..000000000 --- a/src/time/Parser.hxx +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright 2014-2019 Max Kellermann - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * - Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * - Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the - * distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * FOUNDATION OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - * OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef TIME_PARSER_HXX -#define TIME_PARSER_HXX - -#include - -/** - * Parse a time stamp. - * - * Throws std::runtime_error on error. - */ -std::chrono::system_clock::time_point -ParseTimePoint(const char *s, const char *format); - -#endif diff --git a/src/time/meson.build b/src/time/meson.build index f6a57332c..c80cd884f 100644 --- a/src/time/meson.build +++ b/src/time/meson.build @@ -1,6 +1,5 @@ time = static_library( 'time', - 'Parser.cxx', 'Convert.cxx', 'ISO8601.cxx', 'Math.cxx', diff --git a/subprojects/expat.wrap b/subprojects/expat.wrap index a659cdf56..bcc5c03a1 100644 --- a/subprojects/expat.wrap +++ b/subprojects/expat.wrap @@ -1,12 +1,12 @@ [wrap-file] -directory = expat-2.4.8 -source_url = https://github.com/libexpat/libexpat/releases/download/R_2_4_8/expat-2.4.8.tar.xz -source_filename = expat-2.4.8.tar.bz2 -source_hash = f79b8f904b749e3e0d20afeadecf8249c55b2e32d4ebb089ae378df479dcaf25 -patch_filename = expat_2.4.8-2_patch.zip -patch_url = https://wrapdb.mesonbuild.com/v2/expat_2.4.8-2/get_patch -patch_hash = e8855d668a0dee74dee909521c91d6723f564167fcad65507fec63b0f2b41f7e -wrapdb_version = 2.4.8-2 +directory = expat-2.4.9 +source_url = https://github.com/libexpat/libexpat/releases/download/R_2_4_9/expat-2.4.9.tar.xz +source_filename = expat-2.4.9.tar.bz2 +source_hash = 6e8c0728fe5c7cd3f93a6acce43046c5e4736c7b4b68e032e9350daa0efc0354 +patch_filename = expat_2.4.9-1_patch.zip +patch_url = https://wrapdb.mesonbuild.com/v2/expat_2.4.9-1/get_patch +patch_hash = 51b42d935008552f9d6c4d3e7511b84690a2a0c9d90165d1d192fc892f0a4787 +wrapdb_version = 2.4.9-1 [provide] expat = expat_dep diff --git a/test/meson.build b/test/meson.build index b10e52ae2..4d650ffe8 100644 --- a/test/meson.build +++ b/test/meson.build @@ -303,11 +303,6 @@ if curl_dep.found() include_directories: inc, dependencies: [ curl_dep, - - # Explicitly linking with zlib here works around a linker - # failure on Windows, because our Windows CURL build is - # statically linked and thus declares no dependency on zlib - zlib_dep, ], )