From 2694195215719ed373349c7a1d8cd3b74c81ec3f Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Thu, 29 Sep 2022 18:17:29 +0200 Subject: [PATCH 01/18] storage/curl: add `noexcept` and [[gnu::pure]] --- src/storage/plugins/CurlStorage.cxx | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/src/storage/plugins/CurlStorage.cxx b/src/storage/plugins/CurlStorage.cxx index 4b5b84553..f03fd13b8 100644 --- a/src/storage/plugins/CurlStorage.cxx +++ b/src/storage/plugins/CurlStorage.cxx @@ -171,8 +171,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, ' '); @@ -182,14 +183,16 @@ 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 @@ -199,20 +202,23 @@ ParseTimeStamp(const char *s) } } +[[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()); } From df71b07e9d2a376a86044c6d06b03c634a53bb32 Mon Sep 17 00:00:00 2001 From: BurroCargado Date: Thu, 29 Sep 2022 19:47:56 +0900 Subject: [PATCH 02/18] storage/curl: fix can't get timestamp of remote file --- NEWS | 2 ++ src/storage/plugins/CurlStorage.cxx | 1 + 2 files changed, 3 insertions(+) diff --git a/NEWS b/NEWS index afea7e9c2..68729891e 100644 --- a/NEWS +++ b/NEWS @@ -1,4 +1,6 @@ ver 0.23.10 (not yet released) +* storage + - curl: fix file time stamps * decoder - ffmpeg: fix libfmt 9 compiler warning * encoder diff --git a/src/storage/plugins/CurlStorage.cxx b/src/storage/plugins/CurlStorage.cxx index f03fd13b8..1cf83639b 100644 --- a/src/storage/plugins/CurlStorage.cxx +++ b/src/storage/plugins/CurlStorage.cxx @@ -284,6 +284,7 @@ public: "" "" "" + "" "" ""); } From 99e65c58ced5c54f8ba8ac5e0d5df52fbd8750b4 Mon Sep 17 00:00:00 2001 From: BurroCargado Date: Thu, 29 Sep 2022 19:48:27 +0900 Subject: [PATCH 03/18] storage/curl: make timestamp parsing more robust According to the latest WebDAV specification (RFC4918), timestamp string in the getlastmodified property is formatted as rfc1123-date, such as "Sun, 06 Nov 1994 08:49:37 GMT". However, to process responses from servers in the older style format specified in RFC2518, timestamps in the HTTP-date format had better be accepted. As described in the libcurl api documentation, curl_getdate() can handle timestamp strings in HTTP-date formats, including rfc1123-date. https://www.rfc-editor.org/rfc/rfc4918#section-15.7 https://www.rfc-editor.org/rfc/rfc2518.html#section-13.7 https://curl.se/libcurl/c/curl_getdate.html --- src/storage/plugins/CurlStorage.cxx | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/storage/plugins/CurlStorage.cxx b/src/storage/plugins/CurlStorage.cxx index 1cf83639b..8c34badb2 100644 --- a/src/storage/plugins/CurlStorage.cxx +++ b/src/storage/plugins/CurlStorage.cxx @@ -194,12 +194,7 @@ ParseStatus(const char *s, size_t length) noexcept static std::chrono::system_clock::time_point 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]] From 5f9438dae69f579de5150a5b5c54889dca022d10 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Fri, 30 Sep 2022 18:16:22 +0200 Subject: [PATCH 04/18] storage/curl: include cleanup --- src/storage/plugins/CurlStorage.cxx | 1 - 1 file changed, 1 deletion(-) diff --git a/src/storage/plugins/CurlStorage.cxx b/src/storage/plugins/CurlStorage.cxx index 8c34badb2..1a6578f68 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/StringCompare.hxx" From 3e25916b37904ed0eccb8e250acaf069c34600a8 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Fri, 30 Sep 2022 18:16:40 +0200 Subject: [PATCH 05/18] time/Parser: remove unused library --- src/time/Parser.cxx | 57 -------------------------------------------- src/time/Parser.hxx | 43 --------------------------------- src/time/meson.build | 1 - 3 files changed, 101 deletions(-) delete mode 100644 src/time/Parser.cxx delete mode 100644 src/time/Parser.hxx 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 276bac22d..9ad16a88d 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', From 568f63100b980cc0c586a946abb08f4f26cb4ded Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Fri, 14 Oct 2022 21:53:05 +0200 Subject: [PATCH 06/18] python/build/libs.py: update zlib to 1.2.13 --- python/build/libs.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/python/build/libs.py b/python/build/libs.py index 0a502c84a..3cbabf1d4 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', ) From 3a70f09dd3129ef8d7d813917e45e48ff1be63dd Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Fri, 14 Oct 2022 21:55:30 +0200 Subject: [PATCH 07/18] python/build/libs.py: update libopenmpt to 0.6.6 --- python/build/libs.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/python/build/libs.py b/python/build/libs.py index 3cbabf1d4..516bd3f33 100644 --- a/python/build/libs.py +++ b/python/build/libs.py @@ -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( From 8f847ec38139cfb528f1dd06420a94ae313a3157 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Fri, 14 Oct 2022 21:58:30 +0200 Subject: [PATCH 08/18] python/build/libs.py: update FFmpeg to 5.1.2 --- python/build/libs.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/python/build/libs.py b/python/build/libs.py index 516bd3f33..156bb8ee6 100644 --- a/python/build/libs.py +++ b/python/build/libs.py @@ -157,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', From a4748d84b00da3df46c1be4cc38084c6042ec00d Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Fri, 14 Oct 2022 21:59:21 +0200 Subject: [PATCH 09/18] python/build/libs.py: update CURL to 7.85.0 --- python/build/libs.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/python/build/libs.py b/python/build/libs.py index 156bb8ee6..284d4834f 100644 --- a/python/build/libs.py +++ b/python/build/libs.py @@ -393,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', From d3f37199b952f3640db6fafa1ca6a5ea82ed7004 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Fri, 14 Oct 2022 22:00:12 +0200 Subject: [PATCH 10/18] python/build/libs.py: update libnfs to 5.0.2 --- python/build/libs.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/python/build/libs.py b/python/build/libs.py index 284d4834f..abe48996b 100644 --- a/python/build/libs.py +++ b/python/build/libs.py @@ -428,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', @@ -440,7 +440,7 @@ libnfs = AutotoolsProject( '--disable-utils', '--disable-examples', ], - base='libnfs-libnfs-5.0.1', + base='libnfs-libnfs-5.0.2', autoreconf=True, ) From 912530ed200a7ba7a26323b4899a0388448660c0 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Fri, 14 Oct 2022 22:38:50 +0200 Subject: [PATCH 11/18] test/meson.build: remove obsolete CURL workaround This appears to have been fixed in some recent CURL version. --- test/meson.build | 5 ----- 1 file changed, 5 deletions(-) diff --git a/test/meson.build b/test/meson.build index fd42e43b0..6c6cc0b3f 100644 --- a/test/meson.build +++ b/test/meson.build @@ -320,11 +320,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, ], ) From 7d78cad8af2373290b1f2c18572fcce0875c1867 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Fri, 14 Oct 2022 22:41:00 +0200 Subject: [PATCH 12/18] doc/user.rst: update Android NDK requirement to 25b --- doc/user.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/user.rst b/doc/user.rst index b2831bab4..57918fad3 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 From 0c7163b9db2be1d11f2404b40f2798ea10f62506 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Fri, 14 Oct 2022 22:46:16 +0200 Subject: [PATCH 13/18] subprojects: update expat --- subprojects/expat.wrap | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) 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 From 31db04a3ca6525fe94eb72191425e3631a2f3e92 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Fri, 14 Oct 2022 22:54:33 +0200 Subject: [PATCH 14/18] meson.build: suppress bogus clang 14 warning on libfmt headers --- meson.build | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/meson.build b/meson.build index a7ab0fa16..e02b06971 100644 --- a/meson.build +++ b/meson.build @@ -251,6 +251,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', From 06266617646369b51632b9d456c8772360bb5d7d Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Fri, 14 Oct 2022 22:57:08 +0200 Subject: [PATCH 15/18] android/Context: fix typo in assert() variable name Closes https://github.com/MusicPlayerDaemon/MPD/issues/1644 --- src/android/Context.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/android/Context.cxx b/src/android/Context.cxx index ebeda6ec4..45bf0a347 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()); From ccc3ee663ba397e4c69f0f1673fd1795002c4abf Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Fri, 14 Oct 2022 23:00:11 +0200 Subject: [PATCH 16/18] java/File: remove assertions to work around -Wtautological-pointer-compare --- src/java/File.cxx | 3 --- 1 file changed, 3 deletions(-) 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); From 76b25a1377397fcde71920f2a78d30615bf055fd Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Fri, 14 Oct 2022 23:14:08 +0200 Subject: [PATCH 17/18] output/alsa: add nullptr check for snd_pcm_name() return value It is not explicitly documented whether snd_pcm_name() is allowed to return NULL: https://www.alsa-project.org/alsa-doc/alsa-lib/group___p_c_m.html#ga5031edc0422df8db1f70af056a12dd77 But apparently this is legal: https://github.com/alsa-project/alsa-lib/blob/0222f45d11e8b71bf651b985b00fdb0addbf3eed/src/pcm/pcm.c#L2761-L2762 That's ... surprising! Closes https://github.com/MusicPlayerDaemon/MPD/issues/1645 --- NEWS | 2 ++ src/output/plugins/AlsaOutputPlugin.cxx | 6 +++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/NEWS b/NEWS index 68729891e..4052ebe41 100644 --- a/NEWS +++ b/NEWS @@ -5,6 +5,8 @@ ver 0.23.10 (not yet released) - 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/src/output/plugins/AlsaOutputPlugin.cxx b/src/output/plugins/AlsaOutputPlugin.cxx index eebd47540..19e57b4dd 100644 --- a/src/output/plugins/AlsaOutputPlugin.cxx +++ b/src/output/plugins/AlsaOutputPlugin.cxx @@ -812,8 +812,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 From e4c8ebe0567dbe2c52cce85c315305515981eb8a Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Fri, 14 Oct 2022 23:51:41 +0200 Subject: [PATCH 18/18] release v0.23.10 --- NEWS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NEWS b/NEWS index 4052ebe41..40408061c 100644 --- a/NEWS +++ b/NEWS @@ -1,4 +1,4 @@ -ver 0.23.10 (not yet released) +ver 0.23.10 (2022/10/14) * storage - curl: fix file time stamps * decoder