Compare commits

...

265 Commits

Author SHA1 Message Date
Max Kellermann
808dd7cc54 release v0.21.6 2019-03-17 23:52:13 +01:00
Max Kellermann
62a129c18f PlaylistFile: ignore empty playlist names
Closes https://github.com/MusicPlayerDaemon/MPD/issues/465 and
https://github.com/MusicPlayerDaemon/MPD/pull/466
2019-03-17 23:46:36 +01:00
Max Kellermann
c18cd941aa lib/xiph: disable Tremor detection if libvorbis was found
And disable libvorbis detection if Tremor was explicitly enabled.

This fixes a crash bug caused by libvorbis/Tremor ABI conflict caused
by commit 4f7d52dbf2
2019-03-17 23:36:52 +01:00
Max Kellermann
6d12c22653 decoder/ogg: ignore the BOS packet after seek to the beginning of song
Previously, MPD would skip the current song after attempting to seek
to its beginnig, because that was a seek to offset 0.  At offset 0,
MPD will see the BOS packet again, which results in throwing
StopDecoder in MPDOpusDecoder::OnOggEnd().

Closes https://github.com/MusicPlayerDaemon/MPD/issues/470
2019-03-17 23:14:59 +01:00
Max Kellermann
b76d78e6ae output/sles: enable power saving mode 2019-03-17 18:04:40 +01:00
Jacob Vosmaer
0a6e484b1a output/plugins/OSXOutputPlugin: add boost meson dependency 2019-03-17 16:59:24 +01:00
Max Kellermann
0bb71f1f20 output/pulse: use pa_channel_map_init_extend() instead of _auto()
Unlike pa_channel_map_init_auto(), pa_channel_map_init_extend() does
not fail if there is no valid mapping for the given channel count, but
instead maps additional "AUX" channels.

Closes https://github.com/MusicPlayerDaemon/MPD/issues/493
2019-03-16 14:03:10 +01:00
Max Kellermann
1aa7cdd602 decoder/opus: fix replay gain when there are no other tags
The `tag_builder.empty()` check was wrong for the SubmitReplayGain()
call.

Closes https://github.com/MusicPlayerDaemon/MPD/issues/497
2019-03-16 13:55:19 +01:00
Max Kellermann
a4b8a0d801 doc/protocol.rst: clarify filter expressions with multiple tag values
Clarification for https://github.com/MusicPlayerDaemon/MPD/issues/505
2019-03-16 13:23:44 +01:00
Max Kellermann
3bf521d5ca song/TagSongFilter: apply negation properly to multiple tag values
The old implementation didn't make a lot of sense; the "!=" operator
was not actually the opposite of "==".

Closes https://github.com/MusicPlayerDaemon/MPD/issues/505
2019-03-16 13:23:02 +01:00
Max Kellermann
0acb55cde5 song/StringFilter: remove obsolete #if 2019-03-16 13:23:02 +01:00
Max Kellermann
6b89fd6100 song/StringFilter: make MatchWithoutNegation() public 2019-03-16 13:23:02 +01:00
Max Kellermann
52ce39dc3e test/TestSongFilter: unit test for song filters
A few of those tests fail due to bugs.
2019-03-16 13:23:02 +01:00
Max Kellermann
7a3e15d8e5 test/meson.build: add section for filter tests 2019-03-16 13:23:02 +01:00
Max Kellermann
cf66a60c60 test/MakeTag: add noexcept 2019-03-16 13:23:02 +01:00
Max Kellermann
9b26d451e4 test/MakeTag: remove static 2019-03-16 13:23:02 +01:00
Max Kellermann
137ffba1b4 test/test_translate_song: move MakeTag() to header 2019-03-16 13:23:02 +01:00
Max Kellermann
5c5dc1b7c0 meson.build: increase protocol version to 0.21.6
There is a minor new feature (commit 713c1f2ba9) and clients might be
interested in detecting it by the protocol version.
2019-03-16 13:23:02 +01:00
Max Kellermann
9e9418294a song/TagSongFilter: eliminate Match(TagItem) 2019-03-15 20:28:27 +01:00
Max Kellermann
b850eb74b7 song/TagSongFilter: add code comments 2019-03-15 19:54:29 +01:00
Max Kellermann
67d73a2aee song/TagSongFilter: improve lambda indent 2019-03-15 19:54:16 +01:00
Max Kellermann
fde9a470dd song/TagSongFilter: eliminate the std::fill_n() call 2019-03-15 19:35:58 +01:00
Max Kellermann
8d1f30e55b tag/Fallback: add API documentation 2019-03-15 19:23:10 +01:00
Max Kellermann
ddd2b60489 doc/protocol.rst: add missing operators to example expressions 2019-03-15 19:14:06 +01:00
Max Kellermann
8777737861 doc/protocol.rst: use double backticks for tag names 2019-03-15 19:11:30 +01:00
Max Kellermann
cb71f6dd04 doc/protocol.rst: clarify the meaning of the any tag type 2019-03-15 19:09:55 +01:00
Max Kellermann
1881b0e975 song/TagSongFilter: rename MatchNN() to Match()
The "NN" suffix used to mean "no negation", but that's not how it's
implemented today.
2019-03-15 19:06:56 +01:00
Max Kellermann
98b29f6d1c meson.build: remove the libwinpthread-1.dll dependency on Windows
Closes https://github.com/MusicPlayerDaemon/MPD/issues/507
2019-03-14 20:07:06 +01:00
Max Kellermann
59fdfd25cb command/database: fix "list" with filter expression
Disable the 0.11 compatibility mode if the only argument is a filter
expression.

Closes https://github.com/MusicPlayerDaemon/MPD/issues/506
2019-03-14 19:50:09 +01:00
Max Kellermann
0d98677212 playlist/flac: copy the URI to fix use-after-free bug
Closes https://github.com/MusicPlayerDaemon/MPD/issues/508
2019-03-14 19:30:33 +01:00
Max Kellermann
38f0c16904 system/UniqueFileDescriptor: add CreatePipeNonBlock() 2019-02-27 23:30:56 +01:00
Max Kellermann
4fbf6b6c95 net/StaticSocketAddress: remove GetAddress() 2019-02-27 23:26:59 +01:00
Max Kellermann
1f8ff48168 net/StaticSocketAddress: add GetLocalRaw() 2019-02-27 23:26:00 +01:00
Max Kellermann
20b6e0d684 net/SocketDescriptor: add SetTcpUserTimeout() 2019-02-27 23:22:12 +01:00
Max Kellermann
713c1f2ba9 Merge branch 'feature/playlist' of git://github.com/miccoli/MPD 2019-02-27 13:49:22 +01:00
Stefano Miccoli
a149bc4c5d update protocol documentation for new semantics of playlist abs. name 2019-02-26 00:12:09 +01:00
Stefano Miccoli
b3a458338a allow loading playlists specified as absolute filesystem paths
implement for the "load" command the same logic used for the "add"
command: local clients can load playlist specified as absolute paths.

For relative paths the old logic is preserved: first look for a stored
playlist, then look in the music directory.
2019-02-26 00:12:09 +01:00
Max Kellermann
44422b2b2f event/ServerSocket, config/Net: abstract socket support 2019-02-25 13:08:33 +01:00
Max Kellermann
f10afd38b5 NEWS: mention the cdio_paranoia build failure fix 2019-02-25 13:08:33 +01:00
Thomas Zander
4c50a5e0b3 Ensure SEEK_SET is set on systems where stdio.h is not pulled in by accident. 2019-02-23 18:04:00 +01:00
Max Kellermann
f255a485b7 increment version number to 0.21.6 2019-02-22 15:28:03 +01:00
Max Kellermann
1930d5774d release v0.21.5 2019-02-22 15:23:33 +01:00
Max Kellermann
7220a76be0 doc/plugins.rst: document udisks2/policykit rule 2019-02-22 15:22:20 +01:00
Max Kellermann
83f7610dd1 storage/udisks2: move empty string check out of the fallback block in MapUTF8()
Even if the LocalStorage is available, return the "udisks://" URI when
the MapUTF8() parameter is an empty string.  This fixes the mount URI
in the state file.
2019-02-22 15:07:40 +01:00
Max Kellermann
30e0644722 db/simple: call ReturnSong() on mounted database
Fixes a memory leak, or an assertion failure in the debug build.
2019-02-22 14:52:13 +01:00
Max Kellermann
3ada464020 db/simple: use C++11 initializer 2019-02-22 14:52:01 +01:00
Max Kellermann
d5983dd362 storage/udisks2: use the relative path
Closes 
2019-02-22 14:41:56 +01:00
Max Kellermann
98258acc37 storage/udisks2: pass Path to SetMountPoint() 2019-02-22 14:41:56 +01:00
Max Kellermann
8002bc752f NEWS: mention the udisks2 AlreadyMounted fix 2019-02-22 14:41:56 +01:00
Max Kellermann
834ad7a58f TagPrint: omit tags which were disabled by the client
Closes 
2019-02-22 13:05:38 +01:00
Max Kellermann
e8f2f98048 tag/Mask: fix another typo, this time in operator^=
Similar to commit ff1ff1e54a
2019-02-22 12:44:36 +01:00
Max Kellermann
c672b60d07 build/pkg-config.sh: add comment 2019-02-22 12:39:59 +01:00
Max Kellermann
ea269c9c92 python/build/libs.py: upgrade CURL to 7.64.0 2019-02-22 12:10:06 +01:00
Max Kellermann
1fe3a77640 python/build/libs.py: upgrade FFmpeg to 4.1.1 2019-02-22 12:09:35 +01:00
Max Kellermann
bbaeea1ab7 storage/udisks2: use existing mount point if already mounted
Fixes the "org.freedesktop.UDisks2.Error.AlreadyMounted" error.

Closes 
2019-02-21 13:32:03 +01:00
Max Kellermann
0a3aee9d82 storage/udisks2: move code to SetMountPoint() 2019-02-21 13:31:59 +01:00
Max Kellermann
2434020971 storage/udisks2: adjust lambda indent 2019-02-21 13:31:57 +01:00
Max Kellermann
41e0eb7378 lib/dbus/udisks2: parse the MountPoints property 2019-02-21 13:28:26 +01:00
Max Kellermann
6adf964c81 lib/dbus/ReadIter: add dbus_message_iter_get_fixed_array() wrapper 2019-02-21 12:56:05 +01:00
Max Kellermann
b59f37bc0a db/simple/Directory: close the Database in destructor
Fixes assertion failure.
2019-02-20 22:50:15 +01:00
Max Kellermann
cf2d171ccc db/simple: reorder checks in assert() to fix assertion failure
`light_song.Get()` could cause an assertion failure because the
`Manual<>` object must not be used if uninitialized.

Regression by commit ebc006ab52
2019-02-20 21:24:01 +01:00
Max Kellermann
cc28a7b67f Main: create Database on stack, move to Instance after Open() succeeded
This fixes use-after-free bug in SimpleDatabase::Close(), accessing
the `root` object which was already freed by the `catch` block in
Open().

By having the Database on the stack first, we can avoid calling
Close() on the failed-to-open Database from Instance's destructor.

Closes 
2019-02-20 20:50:28 +01:00
Max Kellermann
8b5c33cecd Instance: use std::unique_ptr<> to manage the Database pointer 2019-02-20 20:48:20 +01:00
Max Kellermann
6c28adbcd2 db/Plugin: use std::unique_ptr<> to manage Database pointers 2019-02-20 20:43:31 +01:00
Max Kellermann
2125e3ed57 db/simple/Directory: add noexcept 2019-02-20 20:39:49 +01:00
Max Kellermann
3da7ecfadf mixer/pulse: add missing ParseFloat() check 2019-02-20 19:27:13 +01:00
Max Kellermann
5bb02bbd39 mixer/pulse: move volume_scale_factor up to improve struct packing 2019-02-20 19:25:55 +01:00
Max Kellermann
f11aa09f7c mixer/pulse: add const to volume_scale_factor 2019-02-20 19:25:53 +01:00
Max Kellermann
02eb4752d3 mixer/pulse: use C++11 initializer 2019-02-20 19:25:45 +01:00
Max Kellermann
d9c3215584 mixer/pulse: rename scale to scale_volume
Make it less generic, to avoid clashes.
2019-02-20 19:23:11 +01:00
Clément Pit-Claudel
110e6d026b mixer/pulse: Add a new 'scale' parameter to allow volumes above 100
Closes GH-479.
2019-02-17 16:14:52 -05:00
Max Kellermann
c0f57b8a8b net/IPv[46]Address: update copyright 2019-02-19 13:00:45 +01:00
Max Kellermann
57633fbcb3 net/AllocatedSocketAddress: add methods IsV6Any(), IsV4Mapped() 2019-02-19 12:51:24 +01:00
Max Kellermann
864c87e6c0 net/SocketAddress: add method GetLocalPath() 2019-02-19 12:50:40 +01:00
Max Kellermann
1a516cf3c0 net/AllocatedSocketAddress: add method GetLocalRaw() 2019-02-19 12:43:16 +01:00
Max Kellermann
5c25499c5e lib/cdio/Paranoia: add method GetDiscSectorRange() 2019-02-19 12:40:36 +01:00
Max Kellermann
da4bb4c298 fs/io/OutputStream: update include guard 2019-02-19 12:39:29 +01:00
Max Kellermann
5b8ff61799 fs/io/BufferedOutputStream: add WithBufferedOutputStream() 2019-02-19 12:37:53 +01:00
Max Kellermann
56bded07b1 system/UniqueFileDescriptor: import std::swap 2019-02-19 12:36:54 +01:00
Max Kellermann
db144a43ad system/Open: add OpenWriteOnly(), OpenDirectory() 2019-02-19 12:16:41 +01:00
Max Kellermann
5965f62b56 system/EpollFD: include cleanup 2019-02-19 11:51:52 +01:00
Max Kellermann
05aa9f72a9 util/StringView: add SkipPrefix(), RemoveSuffix() 2019-02-19 11:51:32 +01:00
Max Kellermann
281461f0f0 nfs: work around assertion failure on exception during program init
Closes 
2019-02-15 18:33:58 +01:00
Max Kellermann
f70eb63879 Instance: eliminate FinishShutdownUpdate(), move code to destructor 2019-02-15 18:20:11 +01:00
Max Kellermann
99c23cf139 Instance: eliminate ShutdownDatabase(), move code to destructor
Destruct automatically, even if leaving the scope due to exception
being thrown.
2019-02-15 18:04:23 +01:00
Max Kellermann
9aa75e738c Merge branch 'protocol-doc-typo' of git://github.com/mxjeff/MPD 2019-02-15 18:03:49 +01:00
Max Kellermann
e9c45a9140 playlist/Registry: add RAII class 2019-02-05 23:03:29 +01:00
Max Kellermann
a065c6e6b9 Main: use AtScopeExit() to call DeinitFS() 2019-02-05 23:02:50 +01:00
Max Kellermann
feb5ff9bd2 Mapper: remove empty function mapper_finish() 2019-02-05 23:01:09 +01:00
Max Kellermann
92ec3f0881 valgrind.suppressions: add GObject/libgcrypt/libsmbclient suppressions 2019-02-05 22:53:02 +01:00
Max Kellermann
98c47d9d36 Instance: remove FinishShutdownPartitions()
The list of partitions is cleared automatically.
2019-02-05 22:53:02 +01:00
Max Kellermann
6c67408944 event/Loop: add flag alive
This replaces the old `dead` flag which was unreliable; it was `false`
if the EventThread was not yet started, which could cause deadlocks in
BlockingCall().
2019-02-05 22:38:45 +01:00
Max Kellermann
261a816b21 command/AllCommands: remove empty function command_finish() 2019-02-05 22:15:41 +01:00
Max Kellermann
7a23c123c8 decoder/List: add RAII class 2019-02-05 22:12:22 +01:00
Max Kellermann
e85b24bee0 decoder/List: add noexcept 2019-02-05 22:11:51 +01:00
Max Kellermann
9e73ea77b4 input/Init: add RAII class 2019-02-05 22:07:49 +01:00
Max Kellermann
b0739eca87 test/ConfigGlue: merge duplicate code from various debug programs 2019-02-05 21:56:20 +01:00
Max Kellermann
848f6aa5ab Main: stop io_thread and rtio_thread automatically
They will be stopped by ~EventThread() when the `Instance` is deleted.
2019-02-05 21:49:59 +01:00
Max Kellermann
c9ba4f3f9c archive/List: add RAII class 2019-02-05 21:40:07 +01:00
Max Kellermann
c0e9246a66 archive/List: add noexcept 2019-02-05 21:38:46 +01:00
Max Kellermann
096c23f27d unix/SignalHandlers: add RAII class 2019-02-05 21:36:51 +01:00
Max Kellermann
40bde1eac9 unix/SignalHandlers: add noexcept 2019-02-05 21:36:35 +01:00
Max Kellermann
4b55ed17a9 LogInit: add noexcept 2019-02-05 21:36:35 +01:00
kaliko
4f757a5add Fixed protocol documentation
* "lsinfo" argument is optional
 * "tagtypes disable" arguments are mandatory (typo)
2019-02-03 10:38:34 +01:00
Max Kellermann
674c137e5f NEWS: mention the TagMask typo fix 2019-02-02 15:17:25 +01:00
kaliko
ff1ff1e54a Fixed typo in TagMask 2019-02-02 15:14:31 +01:00
Yue Wang
42b22187c8 [OSXOutput] Throw an error when device not found
Currently it falls back to system default device (either internal speaker or headphone) when device not found. 
I believe it is a better to fail in this case, to make it better aligned with platforms (such as alsa).
2019-01-25 19:50:27 -08:00
Max Kellermann
cfe22502ab fs/io/StdioOutputStream: add noexcept 2019-01-22 09:03:49 +01:00
Max Kellermann
d77b0c7dcd net/SocketAddress: add constexpr 2019-01-22 08:42:35 +01:00
Max Kellermann
5cf889b676 util/WStringView: add missing include 2019-01-22 08:38:03 +01:00
Max Kellermann
ffc36d5255 input/buffered: implement seeking to end of file
Previously, a seek to the end of the file would cause an assertion
failure in SparseMap::Check() because the given offset was invalid.

Closes 
2019-01-22 07:42:00 +01:00
Max Kellermann
0126276e2f FileCommands: log irregular errors while looking for cover art 2019-01-21 22:21:11 +01:00
Max Kellermann
58d6ddab9e FileCommands: catch all exceptions 2019-01-21 22:19:32 +01:00
Max Kellermann
05db6934eb FileCommands: fix deadlock in "albumart" command
Must lock the mutex before calling any of the unprotected InputStream methods.

Closes 
2019-01-21 22:16:46 +01:00
Max Kellermann
02c68c5cdb net/HostParser: add noexcept 2019-01-21 21:20:43 +01:00
Max Kellermann
b02fee7309 util/PrintException: support "const char *" 2019-01-21 21:19:35 +01:00
Max Kellermann
424f75c9e1 util/OffsetPointer: remove redundant inline keywords from constexpr functions 2019-01-21 21:19:09 +01:00
Max Kellermann
f6e1176f97 util/CharUtil: remove redundant inline keywords from constexpr functions 2019-01-21 21:18:23 +01:00
Max Kellermann
e4700c0a27 util/Cast: remove redundant inline keywords from constexpr functions 2019-01-21 21:17:58 +01:00
Max Kellermann
cf23fd8774 fs/io/FileOutputStream: add constructor with directory fd 2019-01-21 21:10:02 +01:00
Max Kellermann
dee8872395 fs/io/FileOutputStream: move code to Open() 2019-01-21 21:09:34 +01:00
Max Kellermann
4ba9357a9c input/CdioParanoia: C++ wrappers for libcdio types 2019-01-21 20:20:20 +01:00
Max Kellermann
48ec09ab1e test/net/TestIPv4Address: make literal unsigned to work around -Wsign-compare 2019-01-21 14:39:24 +01:00
Max Kellermann
754f4048a8 output/shout: evaluate tls option only if TLS is enabled in libshout
Fixes build failure after commit
0cea67ee70
2019-01-21 14:36:43 +01:00
Max Kellermann
037bb07d08 db/VHelper: include DetachedSong.hxx to fix GCC 9 build failure
GCC 9's libstdc++ is unable to use forward-declared types as
std::vector item because the compiler wants to resolve `noexcept()` on
the item destructor.
2019-01-21 14:34:12 +01:00
Max Kellermann
87635c5268 input/CdioParanoia: use the new function names 2019-01-21 14:18:55 +01:00
Max Kellermann
528b4338f4 input/CdioParanoia: use cdio_cddap_free_messages() on recent library versions 2019-01-21 14:16:51 +01:00
Max Kellermann
c780b8bba9 input/CdioParanoia: remove useless cdda_messages() call 2019-01-21 12:36:59 +01:00
Max Kellermann
ca34f3250b input/CdioParanoia: detect libcdio version at compile time
libcdio_paranoia was split from libcdio in version 90, and at the same
time, the header was moved from cdio/paranoia.h to
cdio/paranoia/paranoia.h.  We can easily detect this version at
compile time which is faster than configure time.
2019-01-21 12:14:13 +01:00
Max Kellermann
6a68e1c3f3 test/net/TestIPv6Address: work around failure on macOS 2019-01-21 12:13:52 +01:00
Max Kellermann
85f77ec81d test/net/TestLocalSocketAddress: can't use strcmp() if the string isn't null-terminated. 2019-01-21 12:12:36 +01:00
Max Kellermann
37debed0b8 python/build/libs.py: upgrade Boost to 1.69.0 2019-01-21 10:19:46 +01:00
Max Kellermann
008383f24a python/build/libs.py: upgrade CURL to 7.63.0 2019-01-21 10:11:50 +01:00
Jörg Krause
4f7d52dbf2 meson: add fixed-point Vorbis (Tremor) decoder support
Re-add build support for the fixed-point Vorbis (Tremor) decoder, which
was dropped when switching from Autotools to Meson.

Note, that it is not possible to build both, the Vorbis and the Tremor
decoder.

Closes: 
2019-01-21 08:35:17 +01:00
Max Kellermann
c7848da8f2 input/CdioParanoia: add const to pointer 2019-01-20 22:03:49 +01:00
Max Kellermann
10a6c5c57d input/CdioParanoia: make variables more local 2019-01-20 21:59:57 +01:00
Max Kellermann
2cc2bab309 test/net: new unit tests 2019-01-20 21:05:21 +01:00
Max Kellermann
701fd1d939 net/IPv4Address: fix comment typo 2019-01-20 21:05:12 +01:00
Max Kellermann
d1bdea8edb Merge branch 'shout_tls' of git://github.com/JakobOvrum/MPD 2019-01-20 21:03:42 +01:00
Jakob Ovrum
0cea67ee70 shout output plugin: add support for TLS 2019-01-19 17:36:14 +01:00
Thomas Klausner
3a0480a482 Add missing include of stdlib.h.
Closes https://github.com/MusicPlayerDaemon/MPD/issues/456
2019-01-15 16:52:40 +01:00
Max Kellermann
1fa99da3c2 net/IPv[46]Address: make the initializers even more portable
Similar to 5a5229b499: use more C++14
constexpr.
2019-01-14 19:21:07 +01:00
James D. Smith
22d669da18 Add APE mapping for album artist.
"De-facto" field mappings are available at http://wiki.hydrogenaud.io/index.php?title=Tag_Mapping.
2019-01-14 19:15:42 +01:00
Thomas Zander
772681f23d Fix link_args for mDNSResponder on non-darwin platforms 2019-01-13 14:09:14 +01:00
Max Kellermann
1862a98a44 increment version number to 0.21.5 2019-01-04 19:31:07 +01:00
Max Kellermann
4634b94c83 release v0.21.4 2019-01-04 19:22:21 +01:00
Max Kellermann
6e04a327b4 android/AndroidManifest.xml: increment version number to 0.21.4 2019-01-04 19:22:14 +01:00
Max Kellermann
7ec887eea2 Merge branch 'add-meson-dependencies' of git://github.com/jacobvosmaer/MPD 2019-01-04 19:06:49 +01:00
Max Kellermann
1477b64d4f Merge branch 'patch-2' of git://github.com/HyShai/MPD
Closes 
2019-01-04 19:04:52 +01:00
Max Kellermann
a2c108f5ef NEWS: mention the Haiku build fix 2019-01-04 19:03:53 +01:00
Zoltán Mizsei
f546e76490 Build fix. This struct is the same on Haiku and on Linux, still gcc
fails on it. This fixes.
2019-01-04 19:01:27 +01:00
Zoltán Mizsei
2568bc3957 Haiku is "haiku". 2019-01-04 18:59:49 +01:00
Max Kellermann
7104ac963b util/AllocatedArray: import std::swap 2018-12-28 17:18:41 +01:00
Max Kellermann
2cb36590b2 util/AllocatedArray: add noexcept 2018-12-28 17:17:28 +01:00
Max Kellermann
af7b928d7c output/httpd/Page: remove obsolete API documentation 2018-12-28 17:16:12 +01:00
Max Kellermann
c0d8a9b07a output/httpd/Page: add noexcept 2018-12-28 17:15:28 +01:00
Max Kellermann
5b0d23d553 output/httpd/IcyMetaDataServer: add noexcept 2018-12-28 17:14:27 +01:00
Max Kellermann
ab30695bd1 output/httpd: add noexcept 2018-12-28 17:06:01 +01:00
Max Kellermann
53a4de35c4 util/DynamicFifoBuffer: add noexcept 2018-12-28 17:06:01 +01:00
Max Kellermann
22e6d95c4b remove libwrap support
libwrap is an obscure artefact from a past long ago, when source IP
address meant something.

And its API is "interesting"; it requires the application to expose
two global variables `allow_severity` and `deny_severity`.  This led
to bug .  I don't want to declare those variables; instead, I'd
like to remove libwrap support.

Closes 
2018-12-28 14:16:02 +01:00
Max Kellermann
1c7bd7d5c4 db/update/InotifyQueue: check for ACK_ERROR_UPDATE_ALREADY
Since commit cc64c715a2, UpdateService::Enqueue() throws
ProtocolError(ACK_ERROR_UPDATE_ALREADY) instead of returning 0.
2018-12-28 14:02:41 +01:00
Max Kellermann
3c4ed9cbe3 db/update/InotifyQueue: catch UpdateService::Enqueue() exceptions 2018-12-28 14:00:58 +01:00
Max Kellermann
2677b90244 db/update/InotifyQueue: add noexcept 2018-12-28 14:00:55 +01:00
Max Kellermann
1b20fa441d db/update/InotifyQueue: update code comment 2018-12-28 14:00:10 +01:00
HyShai
18c042d4cf remove non-block call
This is similar to b177bffa6a, in that it fixes the Windows issue of connecting to the open socket. Also, the listen_socket is set to AcceptNonBlock after the connection anyways.
2018-12-18 15:23:40 -05:00
Max Kellermann
98f92d828a NEWS: mention the "ICY" -> "HTTP/1.1" change 2018-12-14 09:26:59 +01:00
HyShai
76268773b5 change HTTP Version to a valid version 2018-12-14 01:51:54 -05:00
Jacob Vosmaer
87542e3080 Add missing pcre_dep in src/song/meson.build 2018-12-09 17:21:38 +01:00
Jacob Vosmaer
66f5b0fed7 Add boost_dep in subdir meson.build files 2018-12-09 17:20:47 +01:00
Max Kellermann
5cb603983e alsa/NonBlock: throw on snd_pcm_poll_descriptors_revents() error
This function is sparsely documented and a look at the bluez-alsa
source code shows that implementations make undocumented assumptions
on the `struct pollfd` array parameter which can lead to strange
effects.
2018-12-04 18:00:52 +01:00
Max Kellermann
9c5790ab1d doc/user.rst: more markup 2018-11-20 22:06:42 +01:00
Max Kellermann
4b7078297d db/upnp: use the generic ::CollectUniqueTags() function
This function implements the "group" feature on top of the
Database::Visit() method.
2018-11-19 20:08:10 +01:00
Max Kellermann
841694ccf2 db/Interface: document CollectUniqueTags() 2018-11-19 19:40:00 +01:00
Max Kellermann
12f4a8255a Main: use DatabasePlugin::RequireStorage() 2018-11-19 19:39:37 +01:00
Max Kellermann
bda77ffc5b db/Interface: remove IsPlugin(), use dynamic_cast instead 2018-11-19 19:38:20 +01:00
Max Kellermann
ed9ece5ea3 db/Interface: make the constructor protected 2018-11-19 19:38:20 +01:00
Max Kellermann
ce49d99c2f check.h: remove obsolete header
Since we switched from autotools to Meson in commit
94592c1406, we don't need to include
`config.h` early to properly enable large file support.  Meson passes
the required macros on the compiler command line instead of defining
them in `config.h`.

This means we can include `config.h` at any time, whenever we want to
check its macros, and there are no ordering constraints.
2018-11-19 16:33:49 +01:00
Max Kellermann
2e450bbf95 src/thread/meson.build: detect pthread_setname_np()
This compile-time check got lost during the Meson transition.
2018-11-19 16:33:14 +01:00
Max Kellermann
303b3071e4 db/UniqueTags: remove pure attribute because function may throw 2018-11-19 11:32:53 +01:00
Max Kellermann
eb6d5f34fc db/UniqueTags: include cleanup 2018-11-19 11:11:45 +01:00
Max Kellermann
f80126959d meson.build: increment PROTOCOL_VERSION to 0.21.4
This version should have been incremented in 0.21.2 because this
version added new search operators.  In 0.21.4, we'll have more
protocol bug fixes which may be important for clients to know.
2018-11-19 11:11:45 +01:00
Max Kellermann
4fb4f6d1b7 increment version number to 0.21.4 2018-11-19 09:58:05 +01:00
Max Kellermann
43df4a7500 release v0.21.3 2018-11-16 13:27:58 +01:00
Max Kellermann
4cdcaa8630 output/alsa: don't call snd_pcm_drain() if nothing was written
Works around a problem where MPD goes into a busy loop because
snd_pcm_drain() always returns `-EAGAIN` without making any progress
(fixes ).

This problem was triggered by snd_pcm_drain() after snd_pcm_cancel()
and snd_pcm_prepare(), but without submitting any data with
snd_pcm_writei().

I believe this is a kernel bug: in non-blocking mode, the kernel's
snd_pcm_drain() function returns early.  In this mode, it only checks
whether snd_pcm_drain_done() has been called already, but
snd_pcm_drain_done() is never called if no data was submitted.

In blocking mode, the following `for` loop detects this condition, so
snd_pcm_drain_done() is not necessary, but without this extra check,
we get `-EAGAIN` forever.
2018-11-16 12:49:37 +01:00
Volodymyr Medvid
04f632296f test/meson.build: run_storage depends on event lib
test/run_storage.cxx depends on EventThread/EventLoop from libevent.a.
Depend on it explicitly. This addresses build failure with
-Dtest=true -Dcurl=disabled -Ddbus=disabled
2018-11-15 19:01:43 +02:00
Max Kellermann
7c8dbcfaac doc/protocol.rst: song position is 0-based 2018-11-15 12:34:23 +01:00
Max Kellermann
436ba3c96c output/alsa: drain the whole ring_buffer, not just one period
This fixes a problem which caused a failure with snd_pcm_writei()
because snd_pcm_drain() had already been called in the previous
iteration.  This commit makes sure that snd_pcm_drain() is only called
after the final snd_pcm_writei() call.

This fixes discarded samples at the end of playback.
2018-11-14 13:35:17 +01:00
Max Kellermann
5d12f52873 output/alsa: clear error after reopening device
When a playback error has occurred, MPD would never recover until one
restarts MPD.
2018-11-14 13:20:54 +01:00
Max Kellermann
a8bf8ede01 event/Thread: reduce the RTIO timer slack to 10us
MPD's default is 100ms, which is too long for the real-time I/O
thread.  The OutputThread has 100us, but the real-time I/O thread
might have tighter deadlines.

This change has currently no effect (I believe), because nobody uses
timers on the RTIO thread.
2018-11-14 12:11:57 +01:00
Max Kellermann
8682183bc3 LogInit: default to journal if MPD was started as systemd service 2018-11-14 12:07:22 +01:00
Max Kellermann
94c31d0da9 doc/mpdconf.example: no, logging is not disabled without log_file 2018-11-14 12:07:22 +01:00
Max Kellermann
464a4cbeec python/build/libs.py: upgrade FFmpeg to 4.1 2018-11-14 11:50:51 +01:00
Max Kellermann
9f0cbf418a python/build/libs.py: upgrade CURL to 7.62.0 2018-11-14 11:50:51 +01:00
Max Kellermann
b477f86c92 output/alsa: don't lock the mutex in CancelInternal()
CancelInternal() doesn't need to be protected because it is called
synchronously from Cancel().
2018-11-14 11:50:51 +01:00
Max Kellermann
020371f145 output/alsa: wake up the client thread after generating silence
Fixes a theoretical race condition which could occur in Drain() (but
was extremely unlikely).
2018-11-14 11:48:55 +01:00
Max Kellermann
ccafe3f3cf output/alsa: don't generate silence if ALSA-PCM buffer has enough data
If our `ring_buffer` is smaller than the ALSA-PCM buffer (if the
latter has more than the 4 periods we allocate), it can happen that
the start threshold is crossed and ALSA switches to
`SND_PCM_STATE_RUNNING`, but the `ring_buffer` is empty.  In this
case, MPDD will generate silence, even though the ALSA-PCM buffer has
enough data.  This causes stuttering ().

This commit amends an older workaround for a similar problem (commit
e08598e7e2) by adding a snd_pcm_avail()
check, and only generate silence if there is less than one period of
data in the ALSA-PCM buffer.

Fixes 
2018-11-14 11:17:59 +01:00
Max Kellermann
3830748de5 output/alsa: clear the period_buffer in LockCaughtError()
The method Cancel() assumes that the `period_buffer` must be empty
when `active==false`, but that is not the case when Play() fails.

Of course the assertion in Cancel() is not 100% correct, but I decided
to rather fix this in LockCaughtError() because the `period_buffer`
should only be accessed from within the RTIO thread, and this is the
only code path where `active` can be set to `false` with a non-empty
`period_buffer`.

Fixes 
2018-11-14 10:24:08 +01:00
Max Kellermann
1a43f5145d output/alsa: throw on snd_pcm_writei() error while draining
This implements real error handling, and avoids calling
CancelInternal() from this code path.
2018-11-14 10:08:29 +01:00
Max Kellermann
7f143a83c1 output/alsa: fix wrong use of errno
alsa-lib doesn't set errno, it returns errors as negative integers.
2018-11-14 10:07:23 +01:00
Max Kellermann
6ccc254179 output/alsa: throw after snd_pcm_drain() error 2018-11-14 10:04:10 +01:00
Max Kellermann
7db2450447 output/alsa: refactor the drain EAGAIN workaround 2018-11-14 10:00:50 +01:00
Max Kellermann
6c2a6a65e0 output/alsa: remove snd_pcm_state() check from DrainInternal()
This check was added 9 years ago in commit
4dc25d3908 to work around a dmix bug
which I assume has been fixed long ago.

Removing this fixes another corner case: if draining is requested
before the start threshold is reached, the PCM is still in
SND_PCM_STATE_PREPARED but not yet SND_PCM_STATE_RUNNING, which means
the submitted data will never be played.  This corner case is
realistic when playing songs shorter than the ALSA buffer (if the
buffer is very large).
2018-11-14 09:48:24 +01:00
Max Kellermann
4247a757b3 output/alsa: call snd_pcm_prepare() if draining is requested early
This fixes a corner case which has probably never occurred and
probably never will: if Cancel() is called, and then Play() followed
by Drain(), the plugin should really play that data.  However
currently, this never happens, because snd_pcm_prepare() is never
called.
2018-11-14 09:43:14 +01:00
Max Kellermann
57e34823d8 increment version number to 0.21.3 2018-11-12 13:59:17 +01:00
Max Kellermann
3c93decdf0 release v0.21.2 2018-11-12 13:33:04 +01:00
Max Kellermann
89e7a5018d doc/protocol.rst: explain song positions vs ids 2018-11-12 13:19:10 +01:00
Max Kellermann
7235b46e5e doc/protocol.rst: rename "current playlist" to "queue" 2018-11-12 13:12:29 +01:00
Max Kellermann
0852226a48 doc/protocol.rst: deprecated close and kill 2018-11-12 13:03:09 +01:00
Max Kellermann
e20d215abf doc/protocol.rst: more markup 2018-11-12 13:01:43 +01:00
Max Kellermann
e4b9b67e24 doc/protocol.rst: deprecation 2018-11-12 12:57:53 +01:00
Max Kellermann
685b78828d doc/protocol.rst: mention that unknown lines may be omitted 2018-11-12 12:57:45 +01:00
Max Kellermann
060908d5c4 song/Filter: add operator "contains"
Closes 
2018-11-12 12:49:01 +01:00
Max Kellermann
0b0f4c61f1 doc/protocol.rst: remove documentation about == matching substrings
I added this sentence in commit
5271e81ebe, but this was merely
documented the legacy status quo, which has always been undocumented
for old-style filters.

But for new filters, using "==" for sub strings was a surprising
"feature", which I removed in commit
ac0852b4e3.
2018-11-12 12:45:40 +01:00
Max Kellermann
228bf7eb09 output/thread: cancel the AudioOutputSource() instead of closing it
This fixes the assertion failure due to calling
AudioOutputSource::Close() twice.
2018-11-12 12:24:25 +01:00
Max Kellermann
5eaf2b8fc3 output/control: always close the AudioOutputSource in RELEASE
Fixes a crash bug with `always_on` outputs which occurs because the
`AudioOutputSource` still has a pointer to an outdated `MusicChunk`.

Fixes 
2018-11-12 12:21:59 +01:00
Max Kellermann
e097fef79e output/control: add command RELEASE
With the new command, the decision to pause or close the output moves
into the output thread.
2018-11-12 12:09:37 +01:00
Max Kellermann
9a813cd3b1 output/Thread: update comment 2018-11-12 12:09:02 +01:00
Max Kellermann
1c60c8e014 output/Filtered: catch Drain() exceptions in CloseOutput() 2018-11-12 12:05:54 +01:00
Max Kellermann
eddda95900 output/interface: document that Drain() may throw 2018-11-12 12:04:42 +01:00
Max Kellermann
72184dccfc song/StringFilter: support regular expressions with "=~" and "!~"
This feature requires `libpcre`.
2018-11-11 12:55:35 +01:00
Max Kellermann
fee75dc766 {output,mixer}/alsa: use snd_pcm_poll_descriptors_revents()
This call was missing, causing very high CPU usage when the ALSA
output plugin was used with dmix.

Closes 
2018-11-11 12:37:29 +01:00
Max Kellermann
ba5c856f15 events/MultiSocketMonitor: add method ForEachResult() 2018-11-11 12:37:28 +01:00
Max Kellermann
12308a0f55 lib/alsa/NonBlock: move the functions into a class managing the state 2018-11-11 12:37:25 +01:00
Max Kellermann
a958abde2f Merge branch 'fix_362' of git://github.com/miccoli/MPD 2018-11-11 12:37:13 +01:00
Max Kellermann
583208db7e output/httpd: fix nullptr dereference crash bug
When `metadata_sent` is `false`, the plugin assumes there is metadata
which must be sent, even if no metadata page was passed to the plugin.
Initializing it to `true` avoids dereferencing this `nullptr`.

Fixes 
2018-11-08 09:37:18 +01:00
Max Kellermann
7b5ba15170 song/Filter: move code to ParseStringFilter() 2018-11-08 00:02:10 +01:00
Max Kellermann
d5e0d49f86 song/{Tag,Uri}SongFilter: pass StringFilter&& to constructor 2018-11-07 23:57:42 +01:00
Max Kellermann
73b22d82aa song/StringFilter: move negated flag from containing class 2018-11-07 23:47:31 +01:00
Max Kellermann
db51cc4e02 lib/zlib/meson.build: add zlib_dep to declare_dependency
Fixes potential compiler error when zlib is installed in a
non-standard directory.
2018-11-07 23:32:23 +01:00
Max Kellermann
be8a52a914 NEWS: mention the ENABLE_ZLIB fix 2018-11-07 23:26:33 +01:00
Max Kellermann
ad597a8ff0 lib/zlib/meson.build: define ENABLE_ZLIB
Fixes 
2018-11-07 23:24:58 +01:00
Max Kellermann
b1fe105904 output/Source: reset current_chunk in Open()
If the output is already open, the `current_chunk` pointer may be
bogus and out of sync with `SharedPipeConsumer::chunk`, leading to an
assertion failure in `SharedPipeConsumer::Consume()`.

Fixes 
2018-11-07 00:17:48 +01:00
Max Kellermann
451b142e3a player/Thread: finish decoder startup before checking the buffer
This fixes a valgrind warning because `buffer_before_play`
initialization needs to know the audio format from the decoder.
2018-11-06 23:52:26 +01:00
Max Kellermann
2833625266 doc/user.rst: more markup 2018-11-06 22:38:34 +01:00
Max Kellermann
0464028872 doc/user.rst: add information about debug build 2018-11-06 22:38:24 +01:00
Max Kellermann
98985c03b0 check.h: remove obsolete ENABLE_LARGEFILE check
Meson always enables large file support on the compiler command line,
thus config.h doesn't need to be included anymore.  We'll remove the
whole `check.h` header soon.

Closes 
2018-11-05 21:25:59 +01:00
Max Kellermann
793fd8c479 decoder/ffmpeg: eliminate GetSampleFormat() 2018-11-04 22:36:17 +01:00
Max Kellermann
6c602811df decoder/ffmepg: fill AudioFormat from AVCodecContext, not AVCodecParameters
`AVCodecParameters` contains values from the codec detected by
avformat_find_stream_info(), but after avcodec_open2(), a different
codec might be selected with a different `AVSampleFormat`.  This leads
to misinterpretation of data returned from FFmpeg, leading to random
noise or silence.

This was observed with FFmpeg 4.0.2 and a TS container file containing
MP2.  A mp3-float codec was detected returning `AV_SAMPLE_FMT_FLTP`,
but finally the `mpegaudiodec_fixed.c` was used, returning
`AV_SAMPLE_FMT_S16`.

By using the audio format from `AVCodecContext`, we ensure that MPD
and FFmpeg always agree on the actual audio format in the buffer.

This removes the FFmpeg bug workaround from commit e1b032cbad which I
assume is obsolete after 7 years.

Fixes 
2018-11-04 22:30:50 +01:00
Stefano Miccoli
6d48a5684a clamp 'set_normalized_volume' to valid values also for ALSA softvol
ensure that valid mixer values are set also when the ALSA driver
does not report a valid dB range ('set_raw' fallback)

correct a bug in which volume is assumed to lie in [0..100]
instead of [0..1]
2018-11-04 22:21:56 +01:00
Max Kellermann
bd115a4008 decoder/ffmpeg: use AtScopeExit() to call av_packet_unref() 2018-11-04 22:01:33 +01:00
Max Kellermann
08272cdee2 decoder/ffmpeg: require FFmpeg 3.1 or later
Drop some compatibility code.
2018-11-04 21:55:06 +01:00
Max Kellermann
b14a5141a6 increment version number to 0.21.2 2018-11-04 19:47:04 +01:00
Max Kellermann
aa0e4500c6 release v0.21.1 2018-11-04 14:08:16 +01:00
Fabian Muscariello
4e6b8edf72 doc/protocol.rst: add missing backticks 2018-11-04 14:04:57 +01:00
Max Kellermann
ac0852b4e3 song/Filter: operator "==" never searches substrings in filter expressions
The protocol documentation says that the difference between `find` and
`search` is that `search` is case insensitive, but that's only half
the truth: `search` also searches for sub strings instead of matching
the whole string.  This part is undocumented and unfortunate, but at
this point, we can't change it.

However leaking this surprising behavior to the new filter expressions
was a bad idea; the "==" operator should never match substrings.  For
people who need that, we should add a new operator.
2018-11-04 13:57:34 +01:00
Max Kellermann
6fe43ed969 song/StringFilter: add flag substring
Prepare to stop using substrings for filter expressions.
2018-11-04 13:49:47 +01:00
Max Kellermann
b34bc06624 song/StringFilter: use std::string::operator== 2018-11-04 13:49:38 +01:00
Max Kellermann
08e41e60e5 meson.build: downgrade Boost 1.67 error to warning
Some Boost 1.67 packages apparently have a workaround for the bug, so
let them build MPD.
2018-11-04 12:45:22 +01:00
Max Kellermann
10ec478a9c meson.build: refuse to build with buggy Boost version 1.67 2018-11-04 12:31:49 +01:00
Max Kellermann
86f1074905 lib/xiph/meson.build: the Vorbis encoder requires the Vorbis decoder
Without the Vorbis decoder, `libvorbis` is never detected, leading to
linker failures when attempting to build the Vorbis encoder.
2018-11-04 12:21:23 +01:00
Max Kellermann
8e66b855a3 doc/protocol.rst: mention that sub-expressios must be enclosed in parantheses
Closes 
2018-11-04 12:12:38 +01:00
Max Kellermann
e3bc85d7bf meson.build: require Meson 0.47.2
Meson 0.47.1 suffers from a bug which breaks linking the MPD
executable because the `-lpthread` flag is not propagated from our
`thread.a`.

See https://github.com/mesonbuild/meson/pull/3895

Closes 
2018-11-04 11:54:40 +01:00
Max Kellermann
6f242836e6 lib/xiph/meson.build: fix typo, replace and with or
Fixes linker failure when building without FLAC support.

Closes 
2018-11-04 11:36:28 +01:00
Max Kellermann
f2c926f3b6 zeroconf/glue: add fallback value for HOST_NAME_MAX
`HOST_NAME_MAX` is not a portable macro; it is undefined on some
systems.

Closes 
2018-11-04 11:12:03 +01:00
Max Kellermann
aba18924ee win32/build.py: link libstdc++ and libcc statically
Fixes 
2018-11-04 11:10:00 +01:00
Max Kellermann
aa6bef54dd python/build/zlib.py: build zlib as a static library
Fixes one part of 
2018-11-04 11:10:00 +01:00
Max Kellermann
528f5b9cb9 song/Filter: allow escaping quotes in filter expressions
Closes 
2018-11-02 19:15:08 +01:00
Max Kellermann
96ae0ec93a remove some autotools remains
Closes 
2018-11-02 18:55:49 +01:00
Max Kellermann
5a5229b499 net/IPv[46]Address: make the initializers more portable
Thanks to C++14, we can declare and fill variables inside `constexpr`
functions.  This means me can stop make assumptions on the `struct`
layouts without losing `constexpr`.

Closes 
2018-11-02 17:47:43 +01:00
Max Kellermann
bba22c9c8c system/FileDescriptor: check __linux__ instead of __linux
`__linux` is the deprecated non-standard macros which appears to be
not present at all on PowerPC.

Closes 
2018-11-02 16:50:38 +01:00
Max Kellermann
694c437a2c NEWS: mention the FFmpeg build fix 2018-11-02 16:50:35 +01:00
Max Kellermann
587172efa3 Merge branch 'patch-1' of git://github.com/joerg-krause/MPD 2018-11-01 19:17:10 +01:00
Max Kellermann
2a926063b2 src/lib/ffmpeg/meson.build: copy dependencies into ffmpeg_dep
Apparently, Meson propagates the linker flags but not the compiler
flags from a `static_library`'s dependencies list.

Closes 
2018-11-01 19:14:00 +01:00
Jörg Krause
d6f239e54f meson: fix typo in options plugins comment 2018-11-01 19:06:54 +01:00
Max Kellermann
b8989fafeb increment version number to 0.21.1 2018-11-01 17:23:47 +01:00
854 changed files with 3266 additions and 2233 deletions
.gitignoreNEWS
android
autogen.sh
build
doc
meson.buildmeson_options.txt
python/build
scripts
src
AudioParser.cxxCheckAudioFormat.cxxIcyMetaDataParser.cxxIdle.cxxIdleFlags.cxxInstance.cxxInstance.hxxLocateUri.hxxLog.cxxLogBackend.cxxLogBackend.hxxLogInit.cxxLogInit.hxxMain.cxxMapper.cxxMapper.hxxMixRampInfo.hxxMusicBuffer.cxxMusicChunk.cxxMusicChunkPtr.cxxMusicChunkPtr.hxxMusicPipe.cxxPartition.hxxPermission.hxxPlaylistDatabase.cxxPlaylistDatabase.hxxPlaylistError.cxxPlaylistFile.cxxPlaylistPrint.cxxRemoteTagCache.cxxRemoteTagCache.hxxReplayGainConfig.hxxReplayGainGlobal.cxxReplayGainGlobal.hxxReplayGainInfo.cxxReplayGainInfo.hxxSongLoader.cxxSongLoader.hxxSongPrint.cxxSongSave.cxxStateFile.cxxStateFile.hxxStateFileConfig.cxxStateFileConfig.hxxStats.cxxTagArchive.cxxTagArchive.hxxTagFile.cxxTagFile.hxxTagPrint.cxxTagSave.cxxTagStream.cxxTagStream.hxxTimePrint.cxx
android
archive
client
command
config
db
decoder
encoder
event
filter
fs
input
java
lib
mixer
neighbor
net
output
pcm
player
playlist
protocol
queue
song
sticker
storage
system
tag
thread
unix
util
win32
zeroconf
test
valgrind.suppressions
win32

80
.gitignore vendored

@@ -1,88 +1,8 @@
*.Plo
*.Po
*.a
*.d
*.la
*.lo
*.o
*.exe
*~
.#*
.stgit*
.deps
.dirstamp
tags
/Makefile
/Makefile.in
/aclocal.m4
/autom4te.cache
/config.h
/config.h.in
/config.log
/config.mk
/config.status
/config_detected.h
/config_detected.mk
/configure
/configure.lineno
/depmode
/libtool
/ltmain.sh
/mkinstalldirs
/output/
/src/mpd
/systemd/system/mpd.service
/systemd/user/mpd.service
/stamp-h1
/src/dsd2pcm/dsd2pcm
/src/win32/mpd_win32_rc.rc
/doc/doxygen.conf
/doc/protocol.html
/doc/protocol
/doc/user
/doc/developer
/doc/sticker
/doc/api
/test/software_volume
/test/run_convert
/test/run_decoder
/test/read_tags
/test/run_filter
/test/run_encoder
/test/run_output
/test/read_conf
/test/run_input
/test/read_mixer
/test/dump_playlist
/test/run_normalize
/test/tmp
/test/run_inotify
/test/test_queue_priority
/test/test_protocol
/test/run_ntp_server
/test/run_resolver
/test/run_tcp_connect
/test/test_pcm
/test/dump_rva2
/test/dump_text_file
/test/test_util
/test/test_byte_reverse
/test/test_mixramp
/test/test_vorbis_encoder
/test/DumpDatabase
/lib/
/*.tar.gz
/*.tar.bz2
/*.tar.xz
/mpd-*/
__pycache__/

91
NEWS

@@ -1,3 +1,94 @@
ver 0.21.6 (2019/03/17)
* protocol
- allow loading playlists specified as absolute filesystem paths
- fix negated filter expressions with multiple tag values
- fix "list" with filter expression
- omit empty playlist names in "listplaylists"
* input
- cdio_paranoia: fix build failure due to missing #include
* decoder
- opus: fix replay gain when there are no other tags
- opus: fix seeking to beginning of song
- vorbis: fix Tremor conflict resulting in crash
* output
- pulse: work around error with unusual channel count
- osx: fix build failure
* playlist
- flac: fix use-after-free bug
* support abstract sockets on Linux
* Windows
- remove the unused libwinpthread-1.dll dependency
* Android
- enable SLES power saving mode
ver 0.21.5 (2019/02/22)
* protocol
- fix deadlock in "albumart" command
- fix "tagtypes disable" command
* database
- simple: fix assertion failure
- fix assertion failures with mount points
* storage
- udisks: fix "AlreadyMounted" error
- udisks: use relative path from mount URI
- fix memory leak
* input
- buffer: fix crash bug when playing remote WAV file
* tags
- ape: map "Album Artist"
* output
- shout: add support for TLS
* mixer
- pulse: add "scale_volume" setting
ver 0.21.4 (2019/01/04)
* database
- inotify: fix crash bug "terminate called after throwing ..."
- upnp: implement "list ... group"
* output
- httpd: declare protocol "HTTP/1.1" instead of "ICY"
* remove libwrap support
* Windows
- fix "Failed to accept connection: unknown error"
* fix Haiku build
ver 0.21.3 (2018/11/16)
* output
- alsa: fix crash bug
- alsa: fix stuttering at start of playback
- alsa: fix discarded samples at end of song
- alsa: clear error after reopening device
* log: default to journal if MPD was started as systemd service
ver 0.21.2 (2018/11/12)
* protocol
- operator "=~" matches a regular expression
- operator "contains" matches substrings
* decoder
- ffmpeg: require FFmpeg 3.1 or later
- ffmpeg: fix broken sound with certain codecs
* output
- alsa: fix high CPU usage with dmix
- httpd: fix three crash bugs
* mixer
- alsa: fix more rounding errors
* fix zlib support
ver 0.21.1 (2018/11/04)
* protocol
- allow escaping quotes in filter expressions
- operator "==" never searches substrings in filter expressions
* decoder
- ffmpeg: fix build failure with non-standard FFmpeg installation path
- flac: fix linker failure when building without FLAC support
* encoder
- vorbis: fix linker failure when building without Vorbis decoder
* fix build failure on Linux-PowerPC
* fix build failure on FreeBSD
* eliminate DLL dependencies on Windows
* add warning about buggy Boost version 1.67
* require Meson 0.47.2 because a Meson 0.47.1 bug breaks our build
ver 0.21 (2018/10/31)
* configuration
- add "include" directive, allows including config files

1
android/.gitignore vendored

@@ -1 +0,0 @@
/build

@@ -2,8 +2,8 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.musicpd"
android:installLocation="auto"
android:versionCode="23"
android:versionName="0.21">
android:versionCode="28"
android:versionName="0.21.6">
<uses-sdk android:minSdkVersion="21" android:targetSdkVersion="26"/>

@@ -1,11 +0,0 @@
#!/bin/sh
set -e
rm -rf config.cache build
mkdir build
aclocal -I m4 $ACLOCAL_FLAGS
autoheader
automake --add-missing $AUTOMAKE_FLAGS
autoconf

@@ -1,5 +1,9 @@
#!/bin/sh -e
# This is a wrapper for pkg-config which helps with cross-compiling;
# it sets up environment variables to pkg-config searches for
# libraries in the sysroot where a copy of this script is located.
BIN=`dirname $0`
ROOT=`dirname "$BIN"`

2
doc/.gitignore vendored

@@ -1,2 +0,0 @@
/html/
/doctrees/

@@ -38,9 +38,9 @@ author = 'Max Kellermann'
# built documents.
#
# The short X.Y version.
version = '0.21'
version = '0.21.6'
# The full version, including alpha/beta/rc tags.
release = '0.21~git'
release = version
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.

@@ -32,7 +32,7 @@
# settings.
#
# The special value "syslog" makes MPD use the local syslog daemon. This
# setting defaults to logging to syslog, otherwise logging is disabled.
# setting defaults to logging to syslog.
#
#log_file "~/.mpd/log"
#

@@ -87,6 +87,22 @@ Mount file systems (e.g. USB sticks or other removable media) using
the udisks2 daemon via D-Bus. To obtain a valid udisks2 URI, consult
:ref:`the according neighbor plugin <neighbor_plugin>`.
It might be necessary to grant :program:`MPD` privileges to control
:program:`udisks2` through :program:`policykit`. To do this, create a
file called :file:`/usr/share/polkit-1/rules.d/mpd-udisks.rules` with
the following text::
polkit.addRule(function(action, subject) {
if ((action.id == "org.freedesktop.udisks2.filesystem-mount" ||
action.id == "org.freedesktop.udisks2.filesystem-mount-other-seat") &&
subject.user == "mpd") {
return polkit.Result.YES;
}
});
If you run MPD as a different user, change ``mpd`` to the name of your
MPD user.
.. _neighbor_plugin:
Neighbor plugins
@@ -935,6 +951,8 @@ The pulse plugin connects to a `PulseAudio <http://www.freedesktop.org/wiki/Soft
- Sets the host name of the PulseAudio server. By default, :program:`MPD` connects to the local PulseAudio server.
* - **sink NAME**
- Specifies the name of the PulseAudio sink :program:`MPD` should play on.
* - **scale_volume FACTOR**
- Specifies a linear scaling coefficient (ranging from 0.5 to 5.0) to apply when adjusting volume through :program:`MPD`. For example, chosing a factor equal to ``"0.7"`` means that setting the volume to 100 in :program:`MPD` will set the PulseAudio volume to 70%, and a factor equal to ``"3.5"`` means that volume 100 in :program:`MPD` corresponds to a 350% PulseAudio volume.
recorder
~~~~~~~~
@@ -974,6 +992,8 @@ You must set a format.
- Set the timeout for the shout connection in seconds. Defaults to 2 seconds.
* - **protocol icecast2|icecast1|shoutcast**
- Specifies the protocol that wil be used to connect to the server. The default is "icecast2".
* - **tls disabled|auto|auto_no_plain|rfc2818|rfc2817**
- Specifies what kind of TLS to use. The default is "disabled" (no TLS).
* - **mount URI**
- Mounts the :program:`MPD` stream in the specified URI.
* - **user USERNAME**

@@ -8,7 +8,7 @@ General protocol syntax
Protocol overview
=================
The ``MPD`` command protocol exchanges
The :program:`MPD` command protocol exchanges
line-based text records between client and server over TCP.
Once the client is connected to the server, they conduct a
conversation until the client closes the connection. The
@@ -144,18 +144,28 @@ syntax::
``EXPRESSION`` is a string enclosed in parantheses which can be one
of:
- ``(TAG == 'VALUE')``: match a tag value.
``(TAG != 'VALUE')``: mismatch a tag value.
The special tag "*any*" checks all
tag values.
*albumartist* looks for
- ``(TAG == 'VALUE')``: match a tag value; if there are multiple
values of the given type, at least one must match.
``(TAG != 'VALUE')``: mismatch a tag value; if there are multiple
values of the given type, none of them must match.
The special tag ``any`` checks all
tag types.
``AlbumArtist`` looks for
``VALUE`` in ``AlbumArtist``
and falls back to ``Artist`` tags if
``AlbumArtist`` does not exist.
``VALUE`` is what to find. The
`find` commands specify an exact value
and are case-sensitive; the `search`
commands specify a sub string and ignore case.
``VALUE`` is what to find.
An empty value string means: match only if the given tag type does
not exist at all; this implies that negation with an empty value
checks for the existence of the given tag type.
- ``(TAG contains 'VALUE')`` checks if the given value is a substring
of the tag value.
- ``(TAG =~ 'VALUE')`` and ``(TAG !~ 'VALUE')`` use a Perl-compatible
regular expression instead of doing a simple string comparison.
(This feature is only available if :program:`MPD` was compiled with
:file:`libpcre`)
- ``(file == 'VALUE')``: match the full song URI
(relative to the music directory).
@@ -173,24 +183,60 @@ of:
- ``(AudioFormat =~ 'SAMPLERATE:BITS:CHANNELS')``:
matches the audio format with the given mask (i.e. one
or more attributes may be "*").
or more attributes may be ``*``).
- ``(!EXPRESSION)``: negate an expression.
- ``(!EXPRESSION)``: negate an expression. Note that each expression
must be enclosed in parantheses, e.g. :code:`(!(artist == 'VALUE'))`
(which is equivalent to :code:`(artist != 'VALUE')`)
- ``(EXPRESSION1 AND EXPRESSION2 ...)``: combine two or
more expressions with logical "and".
more expressions with logical "and". Note that each expression must
be enclosed in parantheses, e.g. :code:`((artist == 'FOO') AND
(album == 'BAR'))`
The :command:`find` commands are case sensitive, which
:command:`search` and related commands ignore case.
Prior to MPD 0.21, the syntax looked like this::
find TYPE VALUE
Escaping String Values
----------------------
String values are quoted with single or double quotes, and special
characters within those values must be escaped with the backslash
(``\``). Keep in mind that the backslash is also the escape character
on the protocol level, which means you may need to use double
backslash.
Example expression which matches an artist named ``foo'bar"``::
(Artist == "foo\'bar\"")
At the protocol level, the command must look like this::
find "(Artist == \"foo\\'bar\\\"\")"
The double quotes enclosing the artist name must be escaped because
they are inside a double-quoted ``find`` parameter. The single quote
inside that artist name must be escaped with two backslashes; one to
escape the single quote, and another one because the backslash inside
the string inside the parameter needs to be escaped as well. The
double quote has three confusing backslashes: two to build one
backslash, and another one to escape the double quote on the protocol
level. Phew!
To reduce confusion, you should use a library such as `libmpdclient
<https://www.musicpd.org/libs/libmpdclient/>`_ which escapes command
arguments for you.
.. _tags:
Tags
====
The following tags are supported by
``MPD``:
The following tags are supported by :program:`MPD`:
* **artist**: the artist name. Its meaning is not well-defined; see "*composer*" and "*performer*" for more specific tags.
* **artistsort**: same as artist, but for sorting. This usually omits prefixes such as "The".
@@ -216,7 +262,7 @@ The following tags are supported by
* **musicbrainz_workid**: the work id in the `MusicBrainz <https://picard.musicbrainz.org/docs/mappings/>`_ database.
There can be multiple values for some of these tags. For
example, ``MPD`` may return multiple
example, :program:`MPD` may return multiple
lines with a ``performer`` tag. A tag value is
a UTF-8 string.
@@ -259,16 +305,17 @@ Recipes
Queuing
=======
Often, users run ``MPD`` with :ref:`random <command_random>` enabled,
but want to be able to insert songs "before" the rest of the playlist.
That is commonly called "queuing".
Often, users run :program:`MPD` with :ref:`random <command_random>`
enabled, but want to be able to insert songs "before" the rest of the
playlist. That is commonly called "queuing".
``MPD`` implements this by allowing the client to specify a "priority"
for each song in the playlist (commands :ref:`priod <command_prio>`
and :ref:`priodid <command_prioid>`). A higher priority means that
the song is going to be played before the other songs.
:program:`MPD` implements this by allowing the client to specify a
"priority" for each song in the playlist (commands :ref:`priod
<command_prio>` and :ref:`priodid <command_prioid>`). A higher
priority means that the song is going to be played before the other
songs.
In "random" mode, ``MPD`` maintains an
In "random" mode, :program:`MPD` maintains an
internal randomized sequence of songs. In this sequence,
songs with a higher priority come first, and all songs with
the same priority are shuffled (by default, all songs are
@@ -293,9 +340,9 @@ Command reference
commands using song ids should be used instead of the commands
that manipulate and control playback based on playlist
position. Using song ids is a safer method when multiple
clients are interacting with ``MPD``.
clients are interacting with :program:`MPD`.
Querying ``MPD``'s status
Querying :program:`MPD`'s status
================================
:command:`clearerror`
@@ -310,7 +357,7 @@ Querying ``MPD``'s status
:command:`idle [SUBSYSTEMS...]` [#since_0_14]_
Waits until there is a noteworthy change in one or more
of ``MPD``'s subsystems. As soon
of :program:`MPD`'s subsystems. As soon
as there is one, it lists all changed systems in a line
in the format ``changed:
SUBSYSTEM``, where SUBSYSTEM is one of the
@@ -319,7 +366,7 @@ Querying ``MPD``'s status
- ``database``: the song database has been modified after :ref:`update <command_update>`.
- ``update``: a database update has started or finished. If the database was modified during the update, the ``database`` event is also emitted.
- ``stored_playlist``: a stored playlist has been modified, renamed, created or deleted
- ``playlist``: the current playlist has been modified
- ``playlist``: the queue (i.e. the current playlist) has been modified
- ``player``: the player has been started, stopped or seeked
- ``mixer``: the volume has been changed
- ``output``: an audio output has been added, removed or modified (e.g. renamed, enabled or disabled)
@@ -340,11 +387,11 @@ Querying ``MPD``'s status
to wait for events as long as mpd runs. The
`idle` command can be canceled by
sending the command `noidle` (no other
commands are allowed). ``MPD``
commands are allowed). :program:`MPD`
will then leave `idle` mode and print
results immediately; might be empty at this time.
If the optional ``SUBSYSTEMS`` argument
is used, ``MPD`` will only send
is used, :program:`MPD` will only send
notifications when something changed in one of the
specified subsytems.
@@ -354,19 +401,21 @@ Querying ``MPD``'s status
Reports the current status of the player and the volume
level.
- ``volume``: ``0-100`` or ``-1`` if the volume cannot be determined
- ``volume``: ``0-100`` (deprecated: ``-1`` if the volume cannot
be determined)
- ``repeat``: ``0`` or ``1``
- ``random``: ``0`` or ``1``
- ``single`` [#since_0_15]_: ``0``, ``1``, or ``oneshot`` [#since_0_21]_
- ``consume`` [#since_0_15]_: ``0`` or ``1``
- ``playlist``: 31-bit unsigned integer, the playlist version number
- ``playlistlength``: integer, the length of the playlist
- ``state``: ``play``, ``stop, or ``pause``
- ``state``: ``play``, ``stop``, or ``pause``
- ``song``: playlist song number of the current song stopped on or playing
- ``songid``: playlist songid of the current song stopped on or playing
- ``nextsong`` [#since_0_15]_: playlist song number of the next song to be played
- ``nextsongid`` [#since_0_15]_: playlist songid of the next song to be played
- ``time``: total time elapsed (of current playing/paused song)
(deprecated, use ``elapsed`` instead)
- ``elapsed`` [#since_0_16]_: Total time elapsed within the current song, but with higher resolution.
- ``duration`` [#since_0_20]_: Duration of the current song in seconds.
- ``bitrate``: instantaneous bitrate in kbps
@@ -377,6 +426,10 @@ Querying ``MPD``'s status
- ``updating_db``: ``job id``
- ``error``: if there is an error, returns message here
:program:`MPD` may omit lines which have no (known) value. Older
:program:`MPD` versions used to have a "magic" value for
"unknown", e.g. ":samp:`volume: -1`".
:command:`stats`
Displays statistics.
@@ -490,8 +543,36 @@ Controlling playback
:command:`stop`
Stops playing.
The current playlist
====================
The Queue
=========
.. note:: The "queue" used to be called "current playlist" or just
"playlist", but that was deemed confusing, because
"playlists" are also files containing a sequence of songs.
Those "playlist files" or "stored playlists" can be
:ref:`loaded into the queue <command_load>` and the queue
can be :ref:`saved into a playlist file <command_save>`, but
they are not to be confused with the queue.
Many of the command names in this section reflect the old
naming convention, but for the sake of compatibility, we
cannot rename commands.
There are two ways to address songs within the queue: by their
position and by their id.
The position is a 0-based index. It is unstable by design: if you
move, delete or insert songs, all following indices will change, and a
client can never be sure what song is behind a given index/position.
Song ids on the other hand are stable: an id is assigned to a song
when it is added, and will stay the same, no matter how much it is
moved around. Adding the same song twice will assign different ids to
them, and a deleted-and-readded song will have a new id. This way, a
client can always be sure the correct song is being used.
Many commands come in two flavors, one for each address type.
Whenever possible, ids should be used.
:command:`add {URI}`
Adds the file ``URI`` to the playlist
@@ -507,7 +588,7 @@ The current playlist
OK
:command:`clear`
Clears the current playlist.
Clears the queue.
.. _command_delete:
@@ -532,13 +613,13 @@ The current playlist
:command:`playlist`
Displays the current playlist.
Displays the queue.
Do not use this, instead use :ref:`playlistinfo
<command_playlistinfo>`.
:command:`playlistfind {TAG} {NEEDLE}`
Finds songs in the current playlist with strict
Finds songs in the queue with strict
matching.
:command:`playlistid {SONGID}`
@@ -556,7 +637,7 @@ The current playlist
:command:`playlistsearch {TAG} {NEEDLE}`
Searches case-insensitively for partial matches in the
current playlist.
queue.
:command:`plchanges {VERSION} [START:END]`
Displays changed songs currently in the playlist since
@@ -593,7 +674,7 @@ The current playlist
but address the songs with their id.
:command:`rangeid {ID} {START:END}` [#since_0_19]_
Since ``MPD``
Since :program:`MPD`
0.19 Specifies the portion of the
song that shall be played. ``START`` and
``END`` are offsets in seconds
@@ -603,7 +684,7 @@ The current playlist
playing cannot be manipulated this way.
:command:`shuffle [START:END]`
Shuffles the current playlist.
Shuffles the queue.
``START:END`` is optional and specifies
a range of songs.
@@ -638,7 +719,9 @@ and without the `.m3u` suffix).
Some of the commands described in this section can be used to
run playlist plugins instead of the hard-coded simple
`m3u` parser. They can access playlists in
the music directory (relative path including the suffix) or
the music directory (relative path including the suffix),
playlists in arbitrary location (absolute path including the suffix;
allowed only for clients that are connected via UNIX domain socket), or
remote playlists (absolute URI with a supported scheme).
:command:`listplaylist {NAME}`
@@ -657,6 +740,8 @@ remote playlists (absolute URI with a supported scheme).
between clients and the server, clients should not
compare this value with their local clock.
.. _command_load:
:command:`load {NAME} [START:END]`
Loads the playlist into the current queue. Playlist
plugins are supported. A range may be specified to load
@@ -687,8 +772,10 @@ remote playlists (absolute URI with a supported scheme).
Removes the playlist `NAME.m3u` from
the playlist directory.
.. _command_save:
:command:`save {NAME}`
Saves the current playlist to
Saves the queue to
`NAME.m3u` in the playlist directory.
The music database
@@ -773,7 +860,7 @@ The music database
:command:`list {TYPE} {FILTER} [group {GROUPTYPE}]`
Lists unique tags values of the specified type.
``TYPE`` can be any tag supported by
``MPD`` or
:program:`MPD` or
*file*.
Additional arguments may specify a :ref:`filter <filter_syntax>`.
@@ -792,10 +879,10 @@ The music database
``URI``.
Do not use this command. Do not manage a client-side
copy of ``MPD``'s database. That
copy of :program:`MPD`'s database. That
is fragile and adds huge overhead. It will break with
large databases. Instead, query
``MPD`` whenever you need
:program:`MPD` whenever you need
something.
.. _command_listallinfo:
@@ -806,16 +893,16 @@ The music database
as :ref:`lsinfo <command_lsinfo>`
Do not use this command. Do not manage a client-side
copy of ``MPD``'s database. That
copy of :program:`MPD`'s database. That
is fragile and adds huge overhead. It will break with
large databases. Instead, query
``MPD`` whenever you need
:program:`MPD` whenever you need
something.
:command:`listfiles {URI}`
Lists the contents of the directory
``URI``, including files are not
recognized by ``MPD``.
recognized by :program:`MPD`.
``URI`` can be a path relative to the
music directory or an URI understood by one of the
storage plugins. The response contains at least one
@@ -829,7 +916,7 @@ The music database
.. _command_lsinfo:
:command:`lsinfo {URI}`
:command:`lsinfo [URI]`
Lists the contents of the directory
``URI``. The response contains records
starting with ``file``,
@@ -922,7 +1009,7 @@ Multiple storages can be "mounted" together, similar to the
`mount` command on many operating
systems, but without cooperation from the kernel. No
superuser privileges are necessary, beause this mapping exists
only inside the ``MPD`` process
only inside the :program:`MPD` process
.. _command_mount:
@@ -965,15 +1052,15 @@ Stickers
"Stickers" [#since_0_15]_ are pieces of
information attached to existing
``MPD`` objects (e.g. song files,
:program:`MPD` objects (e.g. song files,
directories, albums). Clients can create arbitrary name/value
pairs. ``MPD`` itself does not assume
pairs. :program:`MPD` itself does not assume
any special meaning in them.
The goal is to allow clients to share additional (possibly
dynamic) information about songs, which is neither stored on
the client (not available to other clients), nor stored in the
song files (``MPD`` has no write
song files (:program:`MPD` has no write
access).
Client developers should create a standard for common sticker
@@ -1015,14 +1102,21 @@ Connection settings
===================
:command:`close`
Closes the connection to ``MPD``.
``MPD`` will try to send the
Closes the connection to :program:`MPD`.
:program:`MPD` will try to send the
remaining output buffer before it actually closes the
connection, but that cannot be guaranteed. This command
will not generate a response.
Clients should not use this command; instead, they should just
close the socket.
:command:`kill`
Kills ``MPD``.
Kills :program:`MPD`.
Do not use this command. Send ``SIGTERM`` to :program:`MPD`
instead, or better: let your service manager handle :program:`MPD`
shutdown (e.g. :command:`systemctl stop mpd`).
:command:`password {PASSWORD}`
This is used for authentication with the server.
@@ -1044,7 +1138,7 @@ Connection settings
``tagtypes`` sub commands configure this
list.
:command:`tagtypes disable {NAME...]`
:command:`tagtypes disable {NAME...}`
Remove one or more tags from the list of tag types the
client is interested in. These will be omitted from
responses to this client.
@@ -1056,7 +1150,7 @@ Connection settings
:command:`tagtypes clear`
Clear the list of tag types this client is interested
in. This means that ``MPD`` will
in. This means that :program:`MPD` will
not send any tags to this client.
:command:`tagtypes all`

@@ -54,7 +54,7 @@ Download the source tarball from the `MPD home page <https://musicpd.org>`_ and
In any case, you need:
* a C++14 compiler (e.g. gcc 6.0 or clang 3.9)
* `Meson 0.47 <http://mesonbuild.com/>`__ and `Ninja
* `Meson 0.47.2 <http://mesonbuild.com/>`__ and `Ninja
<https://ninja-build.org/>`__
* Boost 1.58
* pkg-config
@@ -67,6 +67,7 @@ For example, the following installs a fairly complete list of build dependencies
.. code-block:: none
apt install g++ \
libpcre3-dev \
libmad0-dev libmpg123-dev libid3tag0-dev \
libflac-dev libvorbis-dev libopus-dev \
libadplug-dev libaudiofile-dev libsndfile1-dev libfaad-dev \
@@ -87,7 +88,7 @@ For example, the following installs a fairly complete list of build dependencies
libupnp-dev \
libavahi-client-dev \
libsqlite3-dev \
libsystemd-dev libwrap0-dev \
libsystemd-dev \
libgtest-dev \
libboost-dev \
libicu-dev
@@ -275,7 +276,9 @@ You can also use multiple storage plugins to assemble a virtual music directory
Configuring database plugins
----------------------------
If a music directory is configured, one database plugin is used. To configure this plugin, add a database block to :file:`mpd.conf`:
If a music directory is configured, one database plugin is used. To
configure this plugin, add a :code:`database` block to
:file:`mpd.conf`:
.. code-block:: none
@@ -290,7 +293,9 @@ reference.
Configuring neighbor plugins
----------------------------
All neighbor plugins are disabled by default to avoid unwanted overhead. To enable (and configure) a plugin, add a neighbor block to :file:`mpd.conf`:
All neighbor plugins are disabled by default to avoid unwanted
overhead. To enable (and configure) a plugin, add a :code:`neighbor`
block to :file:`mpd.conf`:
.. code-block:: none
@@ -303,7 +308,8 @@ More information can be found in the :ref:`neighbor_plugin` reference.
Configuring input plugins
-------------------------
To configure an input plugin, add a input block to :file:`mpd.conf`:
To configure an input plugin, add an :code:`input` block to
:file:`mpd.conf`:
.. code-block:: none
@@ -331,7 +337,8 @@ More information can be found in the :ref:`input_plugins` reference.
Configuring decoder plugins
---------------------------
Most decoder plugins do not need any special configuration. To configure a decoder, add a decoder block to :file:`mpd.conf`:
Most decoder plugins do not need any special configuration. To
configure a decoder, add a :code:`decoder` block to :file:`mpd.conf`:
.. code-block:: none
@@ -367,7 +374,8 @@ Configuring audio outputs
Audio outputs are devices which actually play the audio chunks produced by :program:`MPD`. You can configure any number of audio output devices, but there must be at least one. If none is configured, :program:`MPD` attempts to auto-detect. Usually, this works quite well with ALSA, OSS and on Mac OS X.
To configure an audio output manually, add one or more audio_output blocks to :file:`mpd.conf`:
To configure an audio output manually, add one or more
:code:`audio_output` blocks to :file:`mpd.conf`:
.. code-block:: none
@@ -405,14 +413,21 @@ The following table lists the audio_output options valid for all plugins:
* - **always_on yes|no**
- If set to yes, then :program:`MPD` attempts to keep this audio output always open. This may be useful for streaming servers, when you don't want to disconnect all listeners even when playback is accidentally stopped.
* - **mixer_type hardware|software|null|none**
- Specifies which mixer should be used for this audio output: the hardware mixer (available for ALSA :ref:`alsa_plugin`, OSS :ref:`oss_plugin` and PulseAudio :ref:`pulse_plugin`), the software mixer, the "null" mixer (null; allows setting the volume, but with no effect; this can be used as a trick to implement an external mixer :ref:`external_mixer`) or no mixer (none). By default, the hardware mixer is used for devices which support it, and none for the others.
- Specifies which mixer should be used for this audio output: the
hardware mixer (available for ALSA :ref:`alsa_plugin`, OSS
:ref:`oss_plugin` and PulseAudio :ref:`pulse_plugin`), the
software mixer, the ":samp:`null`" mixer (allows setting the
volume, but with no effect; this can be used as a trick to
implement an external mixer :ref:`external_mixer`) or no mixer
(:samp:`none`). By default, the hardware mixer is used for
devices which support it, and none for the others.
Configuring filters
-------------------
Filters are plugins which modify an audio stream.
To configure a filter, add a filter block to :file:`mpd.conf`:
To configure a filter, add a :code:`filter` block to :file:`mpd.conf`:
.. code-block:: none
@@ -437,9 +452,12 @@ The following table lists the filter options valid for all plugins:
Configuring playlist plugins
----------------------------
Playlist plugins are used to load remote playlists (protocol commands load, listplaylist and listplaylistinfo). This is not related to :program:`MPD`'s playlist directory.
Playlist plugins are used to load remote playlists (protocol commands
load, listplaylist and listplaylistinfo). This is not related to
:program:`MPD`'s :ref:`playlist directory <stored_playlists>`.
To configure a playlist plugin, add a playlist_plugin block to :file:`mpd.conf`:
To configure a playlist plugin, add a :code:`playlist_plugin` block to
:file:`mpd.conf`:
.. code-block:: none
@@ -513,6 +531,12 @@ choice::
bind_to_address "/var/run/mpd/socket"
On Linux, local sockets can be bound to a name without a socket inode
on the filesystem; MPD implements this by prepending ``@`` to the
address::
bind_to_address "@mpd"
If no port is specified, the default port is 6600. This default can
be changed with the port setting::
@@ -816,10 +840,16 @@ The queue
The queue (sometimes called "current playlist") is a list of songs to be played by :program:`MPD`. To play a song, add it to the queue and start playback. Most clients offer an interface to edit the queue.
.. _stored_playlists:
Stored Playlists
----------------
Stored playlists are some kind of secondary playlists which can be created, saved, edited and deleted by the client. They are addressed by their names. Its contents can be loaded into the queue, to be played back. The playlist_directory setting specifies where those playlists are stored.
Stored playlists are some kind of secondary playlists which can be
created, saved, edited and deleted by the client. They are addressed
by their names. Its contents can be loaded into the queue, to be
played back. The :code:`playlist_directory` setting specifies where
those playlists are stored.
Advanced usage
**************
@@ -859,9 +889,11 @@ Obey the "format" row, which indicates that the current playback format is 16 bi
Check list for bit-perfect playback:
* Use the ALSA output plugin.
* Disable sound processing inside ALSA by configuring a "hardware" device (hw:0,0 or similar).
* Don't use software volume (setting mixer_type).
* Don't force :program:`MPD` to use a specific audio format (settings format, audio_output_format).
* Disable sound processing inside ALSA by configuring a "hardware"
device (:samp:`hw:0,0` or similar).
* Don't use software volume (setting :code:`mixer_type`).
* Don't force :program:`MPD` to use a specific audio format (settings
:code:`format`, :code:`audio_output_format`).
* Verify that you are really doing bit-perfect playback using :program:`MPD`'s verbose log and :file:`/proc/asound/card*/pcm*p/sub*/hw_params`. Some DACs can also indicate the audio format.
Direct Stream Digital (DSD)
@@ -876,7 +908,11 @@ DSD (`Direct Stream Digital <https://en.wikipedia.org/wiki/Direct_Stream_Digital
* DoP (DSD over PCM) playback. This wraps DSD inside fake 24 bit PCM according to the DoP standard. Requires a DAC that supports DSD. No support from ALSA and the sound chip required (except for bit-perfect 24 bit PCM support).
* Convert DSD to PCM on-the-fly.
Native DSD playback is used automatically if available. DoP is only used if enabled explicitly using the dop option, because there is no way for :program:`MPD` to find out whether the DAC supports it. DSD to PCM conversion is the fallback if DSD cannot be used directly.
Native DSD playback is used automatically if available. DoP is only
used if enabled explicitly using the :code:`dop` option, because there
is no way for :program:`MPD` to find out whether the DAC supports
it. DSD to PCM conversion is the fallback if DSD cannot be used
directly.
Client Hacks
************
@@ -967,7 +1003,16 @@ All :program:`MPD` crashes are bugs which must be fixed by a developer, and you
A crash bug report needs to contain a "backtrace".
First of all, your :program:`MPD` executable must not be "stripped" (i.e. debug information deleted). The executables shipped with Linux distributions are usually stripped, but some have so-called "debug" packages (package mpd-dbg or mpd-dbgsym on Debian, mpd-debug on other distributions). Make sure this package is installed.
First of all, your :program:`MPD` executable must not be "stripped"
(i.e. debug information deleted). The executables shipped with Linux
distributions are usually stripped, but some have so-called "debug"
packages (package :file:`mpd-dbgsym` or :file:`mpd-dbg` on Debian,
:file:`mpd-debug` on other distributions). Make sure this package is
installed.
If you built :program:`MPD` from sources, please recompile with Meson
option ":code:`--buildtype=debug -Db_ndebug=false`", because this will
add more helpful information to the backtrace.
You can extract the backtrace from a core dump, or by running :program:`MPD` in a debugger, e.g.:
@@ -976,4 +1021,5 @@ You can extract the backtrace from a core dump, or by running :program:`MPD` in
gdb --args mpd --stdout --no-daemon --verbose
run
As soon as you have reproduced the crash, type "bt" on the gdb command prompt. Copy the output to your bug report.
As soon as you have reproduced the crash, type ":command:`bt`" on the
gdb command prompt. Copy the output to your bug report.

@@ -1,8 +1,8 @@
project(
'mpd',
['c', 'cpp'],
version: '0.21',
meson_version: '>= 0.47',
version: '0.21.6',
meson_version: '>= 0.47.2',
default_options: [
'c_std=c99',
'cpp_std=c++14'
@@ -20,7 +20,7 @@ conf.set_quoted('PACKAGE', meson.project_name())
conf.set_quoted('PACKAGE_NAME', meson.project_name())
conf.set_quoted('PACKAGE_VERSION', meson.project_version())
conf.set_quoted('VERSION', meson.project_version())
conf.set_quoted('PROTOCOL_VERSION', '0.21.0')
conf.set_quoted('PROTOCOL_VERSION', '0.21.6')
conf.set_quoted('SYSTEM_CONFIG_FILE_LOCATION', join_paths(get_option('prefix'), get_option('sysconfdir'), 'mpd.conf'))
common_cppflags = [
@@ -99,7 +99,7 @@ is_linux = host_machine.system() == 'linux'
is_android = get_option('android_ndk') != ''
is_darwin = host_machine.system() == 'darwin'
is_windows = host_machine.system() == 'windows'
is_haiku = host_machine.system() == 'haiku' # TODO is this correct?
is_haiku = host_machine.system() == 'haiku'
if is_android
common_cppflags += '-DANDROID'
@@ -172,6 +172,11 @@ inc = include_directories(
)
boost_dep = dependency('boost', version: '>= 1.58')
if boost_dep.version() == '1.67'
# https://github.com/MusicPlayerDaemon/MPD/pull/384
# https://github.com/boostorg/lockfree/commit/12726cda009a855073b9bedbdce57b6ce7763da2
warning('Your Boost version 1.67 is known to be buggy, and the MPD build will fail. Please upgrade to Boost 1.68 or later.')
endif
sources = [
version_cxx,
@@ -307,9 +312,9 @@ subdir('src/lib/curl')
subdir('src/lib/expat')
subdir('src/lib/ffmpeg')
subdir('src/lib/gcrypt')
subdir('src/lib/wrap')
subdir('src/lib/nfs')
subdir('src/lib/oss')
subdir('src/lib/pcre')
subdir('src/lib/pulse')
subdir('src/lib/sndio')
subdir('src/lib/sqlite')
@@ -426,7 +431,6 @@ mpd = build_target(
systemd_dep,
sqlite_dep,
zeroconf_dep,
libwrap_dep,
more_deps,
],
link_args: link_args,

@@ -128,12 +128,13 @@ option('mpg123', type: 'feature', description: 'MP3 decoder using libmpg123')
option('opus', type: 'feature', description: 'Opus decoder plugin')
option('sidplay', type: 'feature', description: 'C64 SID support via libsidplayfp or libsidplay2')
option('sndfile', type: 'feature', description: 'libsndfile decoder plugin')
option('tremor', type: 'feature', description: 'Fixed-point vorbis decoder plugin')
option('vorbis', type: 'feature', description: 'Vorbis decoder plugin')
option('wavpack', type: 'feature', description: 'WavPack decoder plugin')
option('wildmidi', type: 'feature', description: 'WildMidi decoder plugin')
#
# Decoder plugins
# Encoder plugins
#
option('vorbisenc', type: 'feature', description: 'Vorbis encoder plugin')
@@ -175,7 +176,7 @@ option('dbus', type: 'feature', description: 'D-Bus support')
option('expat', type: 'feature', description: 'Expat XML support')
option('icu', type: 'feature', description: 'Use libicu for Unicode')
option('iconv', type: 'feature', description: 'Use iconv() for character set conversion')
option('libwrap', type: 'feature', description: 'libwrap support')
option('pcre', type: 'feature', description: 'Enable regular expression support (using libpcre)')
option('sqlite', type: 'feature', description: 'SQLite database support (for stickers)')
option('yajl', type: 'feature', description: 'libyajl for YAML support')
option('zlib', type: 'feature', description: 'zlib support (for database compression)')

@@ -112,8 +112,8 @@ liblame = AutotoolsProject(
)
ffmpeg = FfmpegProject(
'http://ffmpeg.org/releases/ffmpeg-4.0.2.tar.xz',
'a95c0cc9eb990e94031d2183f2e6e444cc61c99f6f182d1575c433d62afb2f97',
'http://ffmpeg.org/releases/ffmpeg-4.1.1.tar.xz',
'373749824dfd334d84e55dff406729edfd1606575ee44dd485d97d45ea4d2d86',
'lib/libavcodec.a',
[
'--disable-shared', '--enable-static',
@@ -341,8 +341,8 @@ ffmpeg = FfmpegProject(
)
curl = AutotoolsProject(
'http://curl.haxx.se/download/curl-7.61.1.tar.xz',
'3d5913d6a39bd22e68e34dff697fd6e4c3c81563f580c76fca2009315cd81891',
'http://curl.haxx.se/download/curl-7.64.0.tar.xz',
'2f2f13fa34d44aa29cb444077ad7dc4dc6d189584ad552e0aaeb06e608af6001',
'lib/libcurl.a',
[
'--disable-shared', '--enable-static',
@@ -392,7 +392,7 @@ libnfs = AutotoolsProject(
)
boost = BoostProject(
'http://downloads.sourceforge.net/project/boost/boost/1.68.0/boost_1_68_0.tar.bz2',
'7f6130bc3cf65f56a618888ce9d5ea704fa10b462be126ad053e80e553d6d8b7',
'http://downloads.sourceforge.net/project/boost/boost/1.69.0/boost_1_69_0.tar.bz2',
'8f32d4617390d1c2d16f26a27ab60d97807b35440d45891fa340fc2648b04406',
'include/boost/version.hpp',
)

@@ -18,5 +18,5 @@ class ZlibProject(Project):
'INCLUDE_PATH='+ os.path.join(toolchain.install_prefix, 'include'),
'LIBRARY_PATH=' + os.path.join(toolchain.install_prefix, 'lib'),
'BINARY_PATH=' + os.path.join(toolchain.install_prefix, 'bin'),
'SHARED_MODE=1'],
],
cwd=src, env=toolchain.env)

@@ -1,47 +0,0 @@
#!/usr/bin/env ruby
#
# This script verifies that every source includes config.h first.
# This is very important for consistent Large File Support.
#
def check_file(file)
first = true
file.each_line do |line|
if line =~ /^\#include\s+(\S+)/ then
if $1 == '"config.h"'
unless first
puts "#{file.path}: config.h included too late"
end
else
if first
puts "#{file.path}: config.h missing"
end
end
first = false
end
end
end
def check_path(path)
File.open(path) do |file|
check_file(file)
end
end
if ARGV.empty?
Dir["src/*.c"].each do |path|
check_path(path)
end
Dir["src/*/*.c"].each do |path|
check_path(path)
end
Dir["test/*.c"].each do |path|
check_path(path)
end
else
ARGV.each do |path|
check_path(path)
end
end

@@ -22,7 +22,6 @@
*
*/
#include "config.h"
#include "AudioParser.hxx"
#include "AudioFormat.hxx"
#include "util/RuntimeError.hxx"

@@ -17,7 +17,6 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include "config.h"
#include "CheckAudioFormat.hxx"
#include "AudioFormat.hxx"
#include "util/RuntimeError.hxx"

@@ -17,7 +17,6 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include "config.h"
#include "IcyMetaDataParser.hxx"
#include "tag/Tag.hxx"
#include "tag/Builder.hxx"

@@ -22,7 +22,6 @@
*
*/
#include "config.h"
#include "Idle.hxx"
#include "Main.hxx"
#include "Instance.hxx"

@@ -22,7 +22,6 @@
*
*/
#include "config.h"
#include "IdleFlags.hxx"
#include "util/ASCII.hxx"

@@ -30,6 +30,9 @@
#ifdef ENABLE_DATABASE
#include "db/DatabaseError.hxx"
#include "db/Interface.hxx"
#include "db/update/Service.hxx"
#include "storage/StorageInterface.hxx"
#ifdef ENABLE_SQLITE
#include "sticker/StickerDatabase.hxx"
@@ -48,7 +51,19 @@ Instance::Instance()
{
}
Instance::~Instance() noexcept = default;
Instance::~Instance() noexcept
{
#ifdef ENABLE_DATABASE
delete update;
if (database != nullptr) {
database->Close();
database.reset();
}
delete storage;
#endif
}
Partition *
Instance::FindPartition(const char *name) noexcept

@@ -20,7 +20,7 @@
#ifndef MPD_INSTANCE_HXX
#define MPD_INSTANCE_HXX
#include "check.h"
#include "config.h"
#include "event/Loop.hxx"
#include "event/Thread.hxx"
#include "event/MaskMonitor.hxx"
@@ -41,7 +41,7 @@ class NeighborGlue;
#ifdef ENABLE_DATABASE
#include "db/DatabaseListener.hxx"
class Database;
#include "db/Ptr.hxx"
class Storage;
class UpdateService;
#endif
@@ -104,7 +104,7 @@ struct Instance final
#endif
#ifdef ENABLE_DATABASE
Database *database;
DatabasePtr database;
/**
* This is really a #CompositeStorage. To avoid heavy include
@@ -147,7 +147,6 @@ struct Instance final
Partition *FindPartition(const char *name) noexcept;
void BeginShutdownPartitions() noexcept;
void FinishShutdownPartitions() noexcept;
#ifdef ENABLE_DATABASE
/**
@@ -156,7 +155,7 @@ struct Instance final
* music_directory was configured).
*/
Database *GetDatabase() {
return database;
return database.get();
}
/**
@@ -168,8 +167,6 @@ struct Instance final
#endif
void BeginShutdownUpdate() noexcept;
void FinishShutdownUpdate() noexcept;
void ShutdownDatabase() noexcept;
#ifdef ENABLE_CURL
void LookupRemoteTag(const char *uri) noexcept;

@@ -20,7 +20,7 @@
#ifndef MPD_LOCATE_URI_HXX
#define MPD_LOCATE_URI_HXX
#include "check.h"
#include "config.h"
#include "util/Compiler.h"
#include "fs/AllocatedPath.hxx"

@@ -17,7 +17,6 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include "config.h"
#include "LogV.hxx"
#include "util/Domain.hxx"

@@ -17,11 +17,11 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include "config.h"
#include "LogBackend.hxx"
#include "Log.hxx"
#include "util/Domain.hxx"
#include "util/StringStrip.hxx"
#include "config.h"
#include <assert.h>
#include <stdio.h>

@@ -20,7 +20,6 @@
#ifndef MPD_LOG_BACKEND_HXX
#define MPD_LOG_BACKEND_HXX
#include "check.h"
#include "LogLevel.hxx"
void

@@ -30,6 +30,10 @@
#include "util/RuntimeError.hxx"
#include "system/Error.hxx"
#ifdef ENABLE_SYSTEMD_DAEMON
#include <systemd/sd-daemon.h>
#endif
#include <assert.h>
#include <string.h>
#include <fcntl.h>
@@ -105,7 +109,7 @@ parse_log_level(const char *value, int line)
#endif
void
log_early_init(bool verbose)
log_early_init(bool verbose) noexcept
{
#ifdef ANDROID
(void)verbose;
@@ -139,6 +143,16 @@ log_init(const ConfigData &config, bool verbose, bool use_stdout)
if (param == nullptr) {
/* no configuration: default to syslog (if
available) */
#ifdef ENABLE_SYSTEMD_DAEMON
if (sd_booted() &&
getenv("NOTIFY_SOCKET") != nullptr) {
/* if MPD was started as a systemd
service, default to journal (which
is connected to fd=2) */
out_fd = STDOUT_FILENO;
return;
}
#endif
#ifndef HAVE_SYSLOG
throw std::runtime_error("config parameter 'log_file' not found");
#endif
@@ -157,7 +171,7 @@ log_init(const ConfigData &config, bool verbose, bool use_stdout)
#ifndef ANDROID
static void
close_log_files(void)
close_log_files() noexcept
{
#ifdef HAVE_SYSLOG
LogFinishSysLog();
@@ -167,7 +181,7 @@ close_log_files(void)
#endif
void
log_deinit(void)
log_deinit() noexcept
{
#ifndef ANDROID
close_log_files();
@@ -199,7 +213,8 @@ void setup_log_output()
#endif
}
int cycle_log_files(void)
int
cycle_log_files() noexcept
{
#ifdef ANDROID
return 0;

@@ -31,7 +31,7 @@ struct ConfigData;
* @param verbose true when the program is started with --verbose
*/
void
log_early_init(bool verbose);
log_early_init(bool verbose) noexcept;
/**
* Throws #std::runtime_error on error.
@@ -40,12 +40,12 @@ void
log_init(const ConfigData &config, bool verbose, bool use_stdout);
void
log_deinit();
log_deinit() noexcept;
void
setup_log_output();
int
cycle_log_files();
cycle_log_files() noexcept;
#endif /* LOG_H */

@@ -185,19 +185,16 @@ InitStorage(const ConfigData &config, EventLoop &event_loop)
static bool
glue_db_init_and_load(const ConfigData &config)
{
instance->database =
CreateConfiguredDatabase(config, instance->event_loop,
instance->io_thread.GetEventLoop(),
*instance);
if (instance->database == nullptr)
auto db = CreateConfiguredDatabase(config, instance->event_loop,
instance->io_thread.GetEventLoop(),
*instance);
if (!db)
return true;
if (instance->database->GetPlugin().flags & DatabasePlugin::FLAG_REQUIRE_STORAGE) {
if (db->GetPlugin().RequireStorage()) {
InitStorage(config, instance->io_thread.GetEventLoop());
if (instance->storage == nullptr) {
delete instance->database;
instance->database = nullptr;
LogDefault(config_domain,
"Found database setting without "
"music_directory - disabling database");
@@ -211,22 +208,24 @@ glue_db_init_and_load(const ConfigData &config)
}
try {
instance->database->Open();
db->Open();
} catch (...) {
std::throw_with_nested(std::runtime_error("Failed to open database plugin"));
}
if (!instance->database->IsPlugin(simple_db_plugin))
instance->database = std::move(db);
auto *sdb = dynamic_cast<SimpleDatabase *>(instance->database.get());
if (sdb == nullptr)
return true;
SimpleDatabase &db = *(SimpleDatabase *)instance->database;
instance->update = new UpdateService(config,
instance->event_loop, db,
instance->event_loop, *sdb,
static_cast<CompositeStorage &>(*instance->storage),
*instance);
/* run database update after daemonization? */
return db.FileExists();
return sdb->FileExists();
}
static bool
@@ -351,27 +350,6 @@ Instance::BeginShutdownUpdate() noexcept
#endif
}
inline void
Instance::FinishShutdownUpdate() noexcept
{
#ifdef ENABLE_DATABASE
delete update;
#endif
}
inline void
Instance::ShutdownDatabase() noexcept
{
#ifdef ENABLE_DATABASE
if (instance->database != nullptr) {
instance->database->Close();
delete instance->database;
}
delete instance->storage;
#endif
}
inline void
Instance::BeginShutdownPartitions() noexcept
{
@@ -381,12 +359,6 @@ Instance::BeginShutdownPartitions() noexcept
}
}
inline void
Instance::FinishShutdownPartitions() noexcept
{
partitions.clear();
}
void
Instance::OnIdle(unsigned flags)
{
@@ -523,18 +495,19 @@ static int
mpd_main_after_fork(const ConfigData &raw_config, const Config &config)
{
ConfigureFS(raw_config);
AtScopeExit() { DeinitFS(); };
glue_mapper_init(raw_config);
initPermissions(raw_config);
spl_global_init(raw_config);
#ifdef ENABLE_ARCHIVE
archive_plugin_init_all();
const ScopeArchivePluginsInit archive_plugins_init;
#endif
pcm_convert_global_init(raw_config);
decoder_plugin_init_all(raw_config);
const ScopeDecoderPluginsInit decoder_plugins_init(raw_config);
#ifdef ENABLE_DATABASE
const bool create_db = InitDatabaseAndStorage(raw_config);
@@ -553,9 +526,9 @@ mpd_main_after_fork(const ConfigData &raw_config, const Config &config)
}
client_manager_init(raw_config);
input_stream_global_init(raw_config,
instance->io_thread.GetEventLoop());
playlist_list_global_init(raw_config);
const ScopeInputPluginsInit input_plugins_init(raw_config,
instance->io_thread.GetEventLoop());
const ScopePlaylistPluginsInit playlist_plugins_init(raw_config);
#ifdef ENABLE_DAEMON
daemonize_commit();
@@ -564,7 +537,7 @@ mpd_main_after_fork(const ConfigData &raw_config, const Config &config)
#ifndef ANDROID
setup_log_output();
SignalHandlersInit(instance->event_loop);
const ScopeSignalHandlersInit signal_handlers_init(instance->event_loop);
#endif
instance->io_thread.Start();
@@ -652,34 +625,10 @@ mpd_main_after_fork(const ConfigData &raw_config, const Config &config)
}
#endif
instance->FinishShutdownUpdate();
instance->ShutdownDatabase();
#ifdef ENABLE_SQLITE
sticker_global_finish();
#endif
playlist_list_global_finish();
input_stream_global_finish();
#ifdef ENABLE_DATABASE
mapper_finish();
#endif
DeinitFS();
instance->FinishShutdownPartitions();
command_finish();
decoder_plugin_deinit_all();
#ifdef ENABLE_ARCHIVE
archive_plugin_deinit_all();
#endif
instance->rtio_thread.Stop();
instance->io_thread.Stop();
#ifndef ANDROID
SignalHandlersFinish();
#endif
return EXIT_SUCCESS;
}

@@ -58,11 +58,6 @@ mapper_init(AllocatedPath &&_playlist_dir)
mapper_set_playlist_dir(std::move(_playlist_dir));
}
void
mapper_finish() noexcept
{
}
#ifdef ENABLE_DATABASE
AllocatedPath

@@ -24,9 +24,10 @@
#ifndef MPD_MAPPER_HXX
#define MPD_MAPPER_HXX
#include <string>
#include "util/Compiler.h"
#include "config.h"
#include <string>
#define PLAYLIST_FILE_SUFFIX ".m3u"
@@ -36,9 +37,6 @@ class AllocatedPath;
void
mapper_init(AllocatedPath &&playlist_dir);
void
mapper_finish() noexcept;
#ifdef ENABLE_DATABASE
/**

@@ -20,7 +20,6 @@
#ifndef MPD_MIX_RAMP_INFO_HXX
#define MPD_MIX_RAMP_INFO_HXX
#include "check.h"
#include "util/Compiler.h"
#include <string>

@@ -17,7 +17,6 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include "config.h"
#include "MusicBuffer.hxx"
#include "MusicChunk.hxx"

@@ -17,7 +17,6 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include "config.h"
#include "MusicChunk.hxx"
#include "AudioFormat.hxx"
#include "tag/Tag.hxx"

@@ -17,7 +17,6 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include "config.h"
#include "MusicChunkPtr.hxx"
#include "MusicBuffer.hxx"

@@ -20,8 +20,6 @@
#ifndef MPD_MUSIC_CHUNK_PTR_HXX
#define MPD_MUSIC_CHUNK_PTR_HXX
#include "check.h"
#include <memory>
struct MusicChunk;

@@ -17,7 +17,6 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include "config.h"
#include "MusicPipe.hxx"
#include "MusicChunk.hxx"

@@ -31,6 +31,7 @@
#include "SingleMode.hxx"
#include "Chrono.hxx"
#include "util/Compiler.h"
#include "config.h"
#include <string>
#include <memory>

@@ -20,7 +20,7 @@
#ifndef MPD_PERMISSION_HXX
#define MPD_PERMISSION_HXX
#include "check.h"
#include "config.h"
struct ConfigData;

@@ -17,7 +17,6 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include "config.h"
#include "PlaylistDatabase.hxx"
#include "db/PlaylistVector.hxx"
#include "fs/io/TextFile.hxx"

@@ -20,8 +20,6 @@
#ifndef MPD_PLAYLIST_DATABASE_HXX
#define MPD_PLAYLIST_DATABASE_HXX
#include "check.h"
#define PLAYLIST_META_BEGIN "playlist_begin: "
class PlaylistVector;

@@ -17,7 +17,6 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include "config.h"
#include "PlaylistError.hxx"
#include "util/Domain.hxx"

@@ -134,7 +134,9 @@ LoadPlaylistFileInfo(PlaylistInfo &info,
const auto *const name_fs_end =
FindStringSuffix(name_fs_str,
PATH_LITERAL(PLAYLIST_FILE_SUFFIX));
if (name_fs_end == nullptr)
if (name_fs_end == nullptr ||
/* no empty playlist names (raw file name = ".m3u") */
name_fs_end == name_fs_str)
return false;
FileInfo fi;

@@ -17,7 +17,6 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include "config.h"
#include "PlaylistPrint.hxx"
#include "PlaylistFile.hxx"
#include "PlaylistError.hxx"

@@ -17,7 +17,6 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include "config.h"
#include "RemoteTagCache.hxx"
#include "RemoteTagCacheHandler.hxx"
#include "input/ScanTags.hxx"

@@ -20,7 +20,6 @@
#ifndef MPD_REMOTE_TAG_CACHE_HXX
#define MPD_REMOTE_TAG_CACHE_HXX
#include "check.h"
#include "input/RemoteTagScanner.hxx"
#include "tag/Tag.hxx"
#include "event/DeferEvent.hxx"

@@ -20,8 +20,6 @@
#ifndef MPD_REPLAY_GAIN_CONFIG_HXX
#define MPD_REPLAY_GAIN_CONFIG_HXX
#include "check.h"
struct ReplayGainConfig {
static constexpr bool DEFAULT_LIMIT = true;

@@ -17,7 +17,6 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include "config.h"
#include "ReplayGainGlobal.hxx"
#include "ReplayGainConfig.hxx"
#include "config/Param.hxx"

@@ -20,8 +20,6 @@
#ifndef MPD_REPLAY_GAIN_GLOBAL_HXX
#define MPD_REPLAY_GAIN_GLOBAL_HXX
#include "check.h"
struct ConfigData;
struct ReplayGainConfig;

@@ -17,7 +17,6 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include "config.h"
#include "ReplayGainInfo.hxx"
#include "ReplayGainConfig.hxx"

@@ -20,7 +20,6 @@
#ifndef MPD_REPLAY_GAIN_INFO_HXX
#define MPD_REPLAY_GAIN_INFO_HXX
#include "check.h"
#include "util/Compiler.h"
#include "ReplayGainMode.hxx"

@@ -17,7 +17,6 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include "config.h"
#include "SongLoader.hxx"
#include "LocateUri.hxx"
#include "client/Client.hxx"
@@ -25,6 +24,7 @@
#include "storage/StorageInterface.hxx"
#include "song/DetachedSong.hxx"
#include "PlaylistError.hxx"
#include "config.h"
#include <assert.h>

@@ -20,8 +20,8 @@
#ifndef MPD_SONG_LOADER_HXX
#define MPD_SONG_LOADER_HXX
#include "check.h"
#include "util/Compiler.h"
#include "config.h"
#include <cstddef>

@@ -17,7 +17,6 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include "config.h"
#include "SongPrint.hxx"
#include "song/LightSong.hxx"
#include "Partition.hxx"

@@ -17,7 +17,6 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include "config.h"
#include "SongSave.hxx"
#include "AudioParser.hxx"
#include "db/plugins/simple/Song.hxx"

@@ -119,7 +119,7 @@ try {
TextFile file(config.path);
#ifdef ENABLE_DATABASE
const SongLoader song_loader(partition.instance.database,
const SongLoader song_loader(partition.instance.GetDatabase(),
partition.instance.storage);
#else
const SongLoader song_loader(nullptr, nullptr);

@@ -24,6 +24,7 @@
#include "event/TimerEvent.hxx"
#include "fs/AllocatedPath.hxx"
#include "util/Compiler.h"
#include "config.h"
#include <string>
#include <chrono>

@@ -17,7 +17,6 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include "config.h"
#include "StateFileConfig.hxx"
#include "config/Data.hxx"

@@ -20,7 +20,6 @@
#ifndef MPD_STATE_FILE_CONFIG_HXX
#define MPD_STATE_FILE_CONFIG_HXX
#include "check.h"
#include "fs/AllocatedPath.hxx"
#include <chrono>

@@ -124,7 +124,7 @@ stats_print(Response &r, const Partition &partition)
std::lround(partition.pc.GetTotalPlayTime().count()));
#ifdef ENABLE_DATABASE
const Database *db = partition.instance.database;
const Database *db = partition.instance.GetDatabase();
if (db != nullptr)
db_stats_print(r, *db);
#endif

@@ -17,7 +17,6 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include "config.h"
#include "TagArchive.hxx"
#include "TagStream.hxx"
#include "archive/ArchiveFile.hxx"

@@ -20,8 +20,6 @@
#ifndef MPD_TAG_ARCHIVE_HXX
#define MPD_TAG_ARCHIVE_HXX
#include "check.h"
class ArchiveFile;
class TagHandler;
class TagBuilder;

@@ -17,7 +17,6 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include "config.h"
#include "TagFile.hxx"
#include "tag/Generic.hxx"
#include "tag/Handler.hxx"

@@ -20,8 +20,6 @@
#ifndef MPD_TAG_FILE_HXX
#define MPD_TAG_FILE_HXX
#include "check.h"
struct AudioFormat;
class Path;
class TagHandler;

@@ -17,7 +17,6 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include "config.h"
#include "TagPrint.hxx"
#include "tag/Tag.hxx"
#include "tag/Settings.hxx"
@@ -26,8 +25,9 @@
void
tag_print_types(Response &r) noexcept
{
const auto tag_mask = global_tag_mask & r.GetTagMask();
for (unsigned i = 0; i < TAG_NUM_OF_ITEM_TYPES; i++)
if (IsTagEnabled(i))
if (tag_mask.Test(TagType(i)))
r.Format("tagtype: %s\n", tag_item_names[i]);
}

@@ -17,7 +17,6 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include "config.h"
#include "TagSave.hxx"
#include "tag/Tag.hxx"
#include "fs/io/BufferedOutputStream.hxx"

@@ -17,7 +17,6 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include "config.h"
#include "TagStream.hxx"
#include "tag/Generic.hxx"
#include "tag/Handler.hxx"

@@ -20,8 +20,6 @@
#ifndef MPD_TAG_STREAM_HXX
#define MPD_TAG_STREAM_HXX
#include "check.h"
struct AudioFormat;
class InputStream;
class TagHandler;

@@ -17,7 +17,6 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include "config.h"
#include "TimePrint.hxx"
#include "client/Response.hxx"
#include "util/TimeISO8601.hxx"

@@ -17,7 +17,6 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include "config.h"
#include "Context.hxx"
#include "java/Class.hxx"
#include "java/File.hxx"

@@ -17,7 +17,6 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include "config.h"
#include "Environment.hxx"
#include "java/Class.hxx"
#include "java/String.hxx"

@@ -17,7 +17,6 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include "config.h"
#include "LogListener.hxx"
#include "java/Class.hxx"
#include "java/String.hxx"

@@ -49,7 +49,7 @@ static bool archive_plugins_enabled[ARRAY_SIZE(archive_plugins) - 1];
if (archive_plugins_enabled[archive_plugin_iterator - archive_plugins])
const ArchivePlugin *
archive_plugin_from_suffix(const char *suffix)
archive_plugin_from_suffix(const char *suffix) noexcept
{
if (suffix == nullptr)
return nullptr;
@@ -63,7 +63,7 @@ archive_plugin_from_suffix(const char *suffix)
}
const ArchivePlugin *
archive_plugin_from_name(const char *name)
archive_plugin_from_name(const char *name) noexcept
{
archive_plugins_for_each_enabled(plugin)
if (strcmp(plugin->name, name) == 0)
@@ -81,7 +81,8 @@ void archive_plugin_init_all(void)
}
}
void archive_plugin_deinit_all(void)
void
archive_plugin_deinit_all() noexcept
{
archive_plugins_for_each_enabled(plugin)
if (plugin->finish != nullptr)

@@ -33,10 +33,10 @@ extern const ArchivePlugin *const archive_plugins[];
/* interface for using plugins */
const ArchivePlugin *
archive_plugin_from_suffix(const char *suffix);
archive_plugin_from_suffix(const char *suffix) noexcept;
const ArchivePlugin *
archive_plugin_from_name(const char *name);
archive_plugin_from_name(const char *name) noexcept;
/* this is where we "load" all the "plugins" ;-) */
void
@@ -44,6 +44,17 @@ archive_plugin_init_all();
/* this is where we "unload" all the "plugins" */
void
archive_plugin_deinit_all();
archive_plugin_deinit_all() noexcept;
class ScopeArchivePluginsInit {
public:
ScopeArchivePluginsInit() {
archive_plugin_init_all();
}
~ScopeArchivePluginsInit() noexcept {
archive_plugin_deinit_all();
}
};
#endif

@@ -17,7 +17,6 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include "config.h" /* must be first for large file support */
#include "ArchiveLookup.hxx"
#include "ArchiveDomain.hxx"
#include "Log.hxx"

@@ -17,7 +17,6 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include "config.h"
#include "ArchivePlugin.hxx"
#include "ArchiveFile.hxx"
#include "fs/Path.hxx"

@@ -21,7 +21,6 @@
* single bz2 archive handling (requires libbz2)
*/
#include "config.h"
#include "Bzip2ArchivePlugin.hxx"
#include "../ArchivePlugin.hxx"
#include "../ArchiveFile.hxx"

@@ -21,7 +21,6 @@
* iso archive handling (requires cdio, and iso9660)
*/
#include "config.h"
#include "Iso9660ArchivePlugin.hxx"
#include "../ArchivePlugin.hxx"
#include "../ArchiveFile.hxx"

@@ -21,7 +21,6 @@
* zip archive handling (requires zziplib)
*/
#include "config.h"
#include "ZzipArchivePlugin.hxx"
#include "../ArchivePlugin.hxx"
#include "../ArchiveFile.hxx"

@@ -17,11 +17,11 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include "config.h"
#include "ClientInternal.hxx"
#include "util/Domain.hxx"
#include "Partition.hxx"
#include "Instance.hxx"
#include "util/Domain.hxx"
#include "config.h"
const Domain client_domain("client");

@@ -20,7 +20,6 @@
#ifndef MPD_CLIENT_H
#define MPD_CLIENT_H
#include "check.h"
#include "ClientMessage.hxx"
#include "command/CommandListBuilder.hxx"
#include "tag/Mask.hxx"

@@ -17,7 +17,6 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include "config.h"
#include "Client.hxx"
#include "Log.hxx"

@@ -17,7 +17,6 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include "config.h"
#include "ClientInternal.hxx"
#include "Log.hxx"

@@ -17,7 +17,6 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include "config.h"
#include "Client.hxx"
#include "protocol/Ack.hxx"
#include "fs/Path.hxx"

@@ -17,7 +17,6 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include "config.h"
#include "ClientInternal.hxx"
#include "config/Data.hxx"

@@ -17,7 +17,6 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include "config.h"
#include "ClientInternal.hxx"
#include "Response.hxx"
#include "Idle.hxx"

@@ -20,7 +20,6 @@
#ifndef MPD_CLIENT_INTERNAL_HXX
#define MPD_CLIENT_INTERNAL_HXX
#include "check.h"
#include "Client.hxx"
#include "command/CommandResult.hxx"

@@ -17,7 +17,6 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include "config.h"
#include "ClientList.hxx"
#include "ClientInternal.hxx"
#include "util/DeleteDisposer.hxx"

@@ -35,10 +35,6 @@
#include <sys/socket.h>
#endif
#ifdef HAVE_LIBWRAP
#include <tcpd.h>
#endif
static constexpr char GREETING[] = "OK MPD " PROTOCOL_VERSION "\n";
Client::Client(EventLoop &_loop, Partition &_partition,
@@ -66,27 +62,6 @@ client_new(EventLoop &loop, Partition &partition,
assert(fd.IsDefined());
#ifdef HAVE_LIBWRAP
if (address.GetFamily() != AF_LOCAL) {
// TODO: shall we obtain the program name from argv[0]?
const char *progname = "mpd";
struct request_info req;
request_init(&req, RQ_FILE, fd.Get(), RQ_DAEMON, progname, 0);
fromhost(&req);
if (!hosts_access(&req)) {
/* tcp wrappers says no */
FormatWarning(client_domain,
"libwrap refused connection (libwrap=%s) from %s",
progname, remote.c_str());
return;
}
}
#endif /* HAVE_WRAP */
ClientList &client_list = *partition.instance.client_list;
if (client_list.IsFull()) {
LogWarning(client_domain, "Max connections reached");

@@ -17,7 +17,6 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include "config.h"
#include "ClientInternal.hxx"
#include "protocol/Result.hxx"
#include "command/AllCommands.hxx"

@@ -17,7 +17,6 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include "config.h"
#include "ClientInternal.hxx"
#include "Partition.hxx"
#include "Instance.hxx"

@@ -17,7 +17,6 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include "config.h"
#include "ClientInternal.hxx"
#include "Partition.hxx"
#include "Idle.hxx"

@@ -17,7 +17,6 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include "config.h"
#include "Client.hxx"
#include <string.h>

@@ -17,12 +17,12 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include "config.h"
#include "Listener.hxx"
#include "Client.hxx"
#include "Permission.hxx"
#include "net/UniqueSocketDescriptor.hxx"
#include "net/SocketAddress.hxx"
#include "config.h"
static unsigned
GetPermissions(SocketAddress address, int uid) noexcept

@@ -20,7 +20,6 @@
#ifndef MPD_CLIENT_LISTENER_HXX
#define MPD_CLIENT_LISTENER_HXX
#include "check.h"
#include "event/ServerSocket.hxx"
struct Partition;

@@ -17,7 +17,6 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include "config.h"
#include "Response.hxx"
#include "Client.hxx"
#include "util/FormatString.hxx"

@@ -20,7 +20,6 @@
#ifndef MPD_RESPONSE_HXX
#define MPD_RESPONSE_HXX
#include "check.h"
#include "protocol/Ack.hxx"
#include "util/Compiler.h"

@@ -285,11 +285,6 @@ command_init()
#endif
}
void
command_finish()
{
}
static const struct command *
command_lookup(const char *name)
{

Some files were not shown because too many files have changed in this diff Show More