From c692286c67973fd7500e82f189226516818c4e03 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Thu, 27 May 2021 14:02:38 +0200 Subject: [PATCH 01/13] input/last: clear "uri" field in Close() Prevent false negative after the stream was closed automatically after 20 seconds. --- src/input/LastInputStream.cxx | 1 + 1 file changed, 1 insertion(+) diff --git a/src/input/LastInputStream.cxx b/src/input/LastInputStream.cxx index 40bd5ccc2..e0829c122 100644 --- a/src/input/LastInputStream.cxx +++ b/src/input/LastInputStream.cxx @@ -32,6 +32,7 @@ LastInputStream::~LastInputStream() noexcept = default; void LastInputStream::Close() noexcept { + uri.clear(); is.reset(); close_timer.Cancel(); } From a26bf261a908f8c76196d702cd61accf894b52f2 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Thu, 27 May 2021 14:03:46 +0200 Subject: [PATCH 02/13] input/last: call Close() in Open() Prevents a possible bug which occurs when the caller-provided open() function throws; then the "uri" field is never set. --- src/input/LastInputStream.hxx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/input/LastInputStream.hxx b/src/input/LastInputStream.hxx index 635e87741..559d45c16 100644 --- a/src/input/LastInputStream.hxx +++ b/src/input/LastInputStream.hxx @@ -64,8 +64,7 @@ public: return is.get(); } - is.reset(); - close_timer.Cancel(); + Close(); is = open(new_uri, mutex); uri = std::forward(new_uri); From aa6dac9bd2925bcb402530eae68cca36897ebd20 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Mon, 31 May 2021 16:48:20 +0200 Subject: [PATCH 03/13] db/proxy: suppress -Wunused with libmpdclient<2.12 --- src/db/plugins/ProxyDatabasePlugin.cxx | 1 + 1 file changed, 1 insertion(+) diff --git a/src/db/plugins/ProxyDatabasePlugin.cxx b/src/db/plugins/ProxyDatabasePlugin.cxx index a4fe43bcf..28e9676cc 100644 --- a/src/db/plugins/ProxyDatabasePlugin.cxx +++ b/src/db/plugins/ProxyDatabasePlugin.cxx @@ -424,6 +424,7 @@ SendGroup(mpd_connection *connection, TagType group) return mpd_search_add_group_tag(connection, tag); #else (void)connection; + (void)group; throw std::runtime_error("Grouping requires libmpdclient 2.12"); #endif From 82da57b7cea06d461aa60b322ee217627041613b Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Mon, 31 May 2021 16:49:45 +0200 Subject: [PATCH 04/13] decoder/ffmpeg: suppress -Wunused with libavformat<58.6.100 --- src/decoder/plugins/FfmpegDecoderPlugin.cxx | 1 + 1 file changed, 1 insertion(+) diff --git a/src/decoder/plugins/FfmpegDecoderPlugin.cxx b/src/decoder/plugins/FfmpegDecoderPlugin.cxx index 889062ee6..891f7846a 100644 --- a/src/decoder/plugins/FfmpegDecoderPlugin.cxx +++ b/src/decoder/plugins/FfmpegDecoderPlugin.cxx @@ -470,6 +470,7 @@ IsSeekable(const AVFormatContext &format_context) noexcept #if LIBAVFORMAT_VERSION_INT >= AV_VERSION_INT(58, 6, 100) return (format_context.ctx_flags & AVFMTCTX_UNSEEKABLE) != 0; #else + (void)format_context; return false; #endif } From ac59ec34f9d467b423b1f5f68bdfb2e7f2f944c3 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Mon, 31 May 2021 18:08:58 +0200 Subject: [PATCH 05/13] decoder/ffmpeg: fix build failure with FFmpeg 3.4 av_demuxer_iterate() was added in libavformat 58.9.100. Closes https://github.com/MusicPlayerDaemon/MPD/issues/1178 --- NEWS | 1 + src/decoder/plugins/FfmpegDecoderPlugin.cxx | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/NEWS b/NEWS index 47947cc16..abd79a459 100644 --- a/NEWS +++ b/NEWS @@ -3,6 +3,7 @@ ver 0.22.9 (not yet released) - simple: load all .mpdignore files of all parent directories * decoder - ffmpeg: support the tags "sort_album", "album-sort", "artist-sort" + - ffmpeg: fix build failure with FFmpeg 3.4 * Windows - fix build failure with SQLite diff --git a/src/decoder/plugins/FfmpegDecoderPlugin.cxx b/src/decoder/plugins/FfmpegDecoderPlugin.cxx index 891f7846a..c817277e1 100644 --- a/src/decoder/plugins/FfmpegDecoderPlugin.cxx +++ b/src/decoder/plugins/FfmpegDecoderPlugin.cxx @@ -659,6 +659,8 @@ ffmpeg_scan_stream(InputStream &is, TagHandler &handler) return FfmpegScanStream(*f, handler); } +#if LIBAVFORMAT_VERSION_INT >= AV_VERSION_INT(58, 9, 100) + static void ffmpeg_uri_decode(DecoderClient &client, const char *uri) { @@ -690,6 +692,8 @@ ffmpeg_protocols() noexcept return protocols; } +#endif + /** * A list of extensions found for the formats supported by ffmpeg. * This list is current as of 02-23-09; To find out if there are more @@ -813,6 +817,8 @@ static const char *const ffmpeg_mime_types[] = { constexpr DecoderPlugin ffmpeg_decoder_plugin = DecoderPlugin("ffmpeg", ffmpeg_decode, ffmpeg_scan_stream) .WithInit(ffmpeg_init, ffmpeg_finish) +#if LIBAVFORMAT_VERSION_INT >= AV_VERSION_INT(58, 9, 100) .WithProtocols(ffmpeg_protocols, ffmpeg_uri_decode) +#endif .WithSuffixes(ffmpeg_suffixes) .WithMimeTypes(ffmpeg_mime_types); From ab487b9a99f9438bd147e0c3a4d7467287a4c0d8 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Mon, 31 May 2021 20:37:10 +0200 Subject: [PATCH 06/13] Android: use startForegroundService() in Android 8+ Fixes the error: IllegalStateException: Not allowed to start service Intent { cmp=org.musicpd/.Main (has extras) }: app is in background --- NEWS | 2 ++ android/src/Main.java | 11 ++++++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/NEWS b/NEWS index abd79a459..f86f7d631 100644 --- a/NEWS +++ b/NEWS @@ -4,6 +4,8 @@ ver 0.22.9 (not yet released) * decoder - ffmpeg: support the tags "sort_album", "album-sort", "artist-sort" - ffmpeg: fix build failure with FFmpeg 3.4 +* Android + - fix auto-start on boot in Android 8 or later * Windows - fix build failure with SQLite diff --git a/android/src/Main.java b/android/src/Main.java index 2c307811a..15c7ba419 100644 --- a/android/src/Main.java +++ b/android/src/Main.java @@ -414,6 +414,15 @@ public class Main extends Service implements Runnable { * start Main service without any callback */ public static void start(Context context, boolean wakelock) { - context.startService(new Intent(context, Main.class).putExtra("wakelock", wakelock)); + Intent intent = new Intent(context, Main.class) + .putExtra("wakelock", wakelock); + + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) + /* in Android 8+, we need to use this method + or else we'll get "IllegalStateException: + app is in background" */ + context.startForegroundService(intent); + else + context.startService(intent); } } From 175d2c6d2936d914423271e124aa0f18185c063f Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Tue, 22 Jun 2021 20:31:09 +0200 Subject: [PATCH 07/13] Main: use AtScopeExit() to call ZeroconfDeinit() Make sure that ZeroconfDeinit() gets called even if startup fails with an exception. Fixes an assertion failure because an Avahi TimerEvent is still active. Closes https://github.com/MusicPlayerDaemon/MPD/issues/1192 --- src/Main.cxx | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/Main.cxx b/src/Main.cxx index 9d9a3430b..1a2a94ef5 100644 --- a/src/Main.cxx +++ b/src/Main.cxx @@ -477,6 +477,7 @@ MainConfigured(const struct options &options, const ConfigData &raw_config) #endif ZeroconfInit(raw_config, instance.event_loop); + AtScopeExit() { ZeroconfDeinit(); }; #ifdef ENABLE_DATABASE if (create_db) { @@ -537,9 +538,6 @@ MainConfigured(const struct options &options, const ConfigData &raw_config) instance.state_file->Write(); instance.BeginShutdownUpdate(); - - ZeroconfDeinit(); - instance.BeginShutdownPartitions(); } From 6ed9668fea746bf682e87daa07e2350d788c7ce7 Mon Sep 17 00:00:00 2001 From: Naglis Jonaitis Date: Wed, 23 Jun 2021 15:04:18 +0300 Subject: [PATCH 08/13] doc, README.md: update IRC server name/URL --- README.md | 2 +- doc/user.rst | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index ea588710d..1c65bb12d 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ For basic installation instructions - [Manual](http://www.musicpd.org/doc/user/) - [Forum](http://forum.musicpd.org/) -- [IRC](irc://chat.freenode.net/#mpd) +- [IRC](ircs://irc.libera.chat:6697/#mpd) - [Bug tracker](https://github.com/MusicPlayerDaemon/MPD/issues/) # Developers diff --git a/doc/user.rst b/doc/user.rst index 1bc8f6158..ac8f7273d 100644 --- a/doc/user.rst +++ b/doc/user.rst @@ -1120,7 +1120,7 @@ Support Getting Help ^^^^^^^^^^^^ -The :program:`MPD` project runs a `forum `_ and an IRC channel (#mpd on Freenode) for requesting help. Visit the MPD help page for details on how to get help. +The :program:`MPD` project runs a `forum `_ and an IRC channel (#mpd on Libera.Chat) for requesting help. Visit the MPD help page for details on how to get help. Common Problems ^^^^^^^^^^^^^^^ From af72a22ed86012cee7ab31b8d53b1c72e6b45c2a Mon Sep 17 00:00:00 2001 From: Naglis Jonaitis Date: Sun, 20 Jun 2021 00:30:29 +0300 Subject: [PATCH 09/13] doc/user.rst: document restore_paused --- doc/user.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/doc/user.rst b/doc/user.rst index ac8f7273d..515f57bd7 100644 --- a/doc/user.rst +++ b/doc/user.rst @@ -688,6 +688,8 @@ The State File - Specify the state file location. The parent directory must be writable by the :program:`MPD` user (+wx). * - **state_file_interval SECONDS** - Auto-save the state file this number of seconds after each state change. Defaults to 120 (2 minutes). + * - **restore_paused yes|no** + - If set to :samp:`yes`, then :program:`MPD` is put into pause mode instead of starting playback after startup. Default is :samp:`no`. The Sticker Database ^^^^^^^^^^^^^^^^^^^^ From 8be0bcbdb9acbfd093ddc0cd907daa217cc99d11 Mon Sep 17 00:00:00 2001 From: Naglis Jonaitis Date: Sat, 19 Jun 2021 21:06:05 +0300 Subject: [PATCH 10/13] doc/plugins.rst: mention default libsamplerate type --- doc/plugins.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/plugins.rst b/doc/plugins.rst index 3a4cf4b1a..ee637f20a 100644 --- a/doc/plugins.rst +++ b/doc/plugins.rst @@ -715,7 +715,7 @@ A resampler using `libsamplerate `_ a.k.a. Secret * - Name - Description * - **type** - - The interpolator type. See below for a list of known types. + - The interpolator type. Defaults to :samp:`2`. See below for a list of known types. The following converter types are provided by libsamplerate: From 5019bdcd5298541a191d9824b8e5c8aff9fdbca1 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Wed, 23 Jun 2021 20:46:50 +0200 Subject: [PATCH 11/13] TagAny: invoke ScanGenericTags() on remote files This fixes reading ID3 tags on remote files with the commands "readcomments" and "readpicture". Closes https://github.com/MusicPlayerDaemon/MPD/issues/1180 --- NEWS | 2 ++ src/TagAny.cxx | 8 +++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/NEWS b/NEWS index f86f7d631..ef1a70797 100644 --- a/NEWS +++ b/NEWS @@ -1,6 +1,8 @@ ver 0.22.9 (not yet released) * database - simple: load all .mpdignore files of all parent directories +* tags + - fix "readcomments" and "readpicture" on remote files with ID3 tags * decoder - ffmpeg: support the tags "sort_album", "album-sort", "artist-sort" - ffmpeg: fix build failure with FFmpeg 3.4 diff --git a/src/TagAny.cxx b/src/TagAny.cxx index faa237b4c..6f875846e 100644 --- a/src/TagAny.cxx +++ b/src/TagAny.cxx @@ -25,6 +25,7 @@ #include "client/Client.hxx" #include "protocol/Ack.hxx" #include "fs/AllocatedPath.hxx" +#include "input/InputStream.hxx" #include "util/Compiler.h" #include "util/UriExtract.hxx" #include "LocateUri.hxx" @@ -32,8 +33,13 @@ static void TagScanStream(const char *uri, TagHandler &handler) { - if (!tag_stream_scan(uri, handler)) + Mutex mutex; + + auto is = InputStream::OpenReady(uri, mutex); + if (!tag_stream_scan(*is, handler)) throw ProtocolError(ACK_ERROR_NO_EXIST, "Failed to load file"); + + ScanGenericTags(*is, handler); } static void From 2052b461afd3ff06dc30cef06e92a580e85c1a99 Mon Sep 17 00:00:00 2001 From: Yetangitu Date: Wed, 23 Jun 2021 15:46:17 +0000 Subject: [PATCH 12/13] Fix android build error when confronted with package versions ending in +revision_information The script seems to assume package version numbers always end in numeric versions with an optional alpha-suffix. Alas, were it only so simple... Sometimes the package is called fizzbang-1.2.3+release_info in which case the build fails. No more! Closes https://github.com/MusicPlayerDaemon/MPD/issues/1177 --- python/build/project.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/build/project.py b/python/build/project.py index a0cfa60ba..374ccdb14 100644 --- a/python/build/project.py +++ b/python/build/project.py @@ -20,7 +20,7 @@ class Project: self.base = base if name is None or version is None: - m = re.match(r'^([-\w]+)-(\d[\d.]*[a-z]?[\d.]*(?:-alpha\d+)?)$', self.base) + m = re.match(r'^([-\w]+)-(\d[\d.]*[a-z]?[\d.]*(?:-alpha\d+)?)(\+.*)?$', self.base) if name is None: name = m.group(1) if version is None: version = m.group(2) From 18628bf89ebfa5a806971479a71cf9b5764e500e Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Wed, 23 Jun 2021 20:56:13 +0200 Subject: [PATCH 13/13] release v0.22.9 --- NEWS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NEWS b/NEWS index ef1a70797..64c3d23d2 100644 --- a/NEWS +++ b/NEWS @@ -1,4 +1,4 @@ -ver 0.22.9 (not yet released) +ver 0.22.9 (2021/06/23) * database - simple: load all .mpdignore files of all parent directories * tags