Commit Graph

14022 Commits

Author SHA1 Message Date
Max Kellermann
a4e4217204 Main: ignore the "pid_file" setting if started as systemd service
Commit 552c30eae caused problems for those people who still had a
"pid_file" setting (even though that is obsolete with systemd),
because now /run/mpd is owned by root:root (our mpd.service has no
User=mpd directive, so systemd starts MPD as root).

To work around this problem, and to be able to keep
RuntimeDirectory=mpd (which solved a problem of other MPD users), the
best compromise seems to just ignore the "pid_file" setting when it is
of no use.
2021-11-05 09:02:56 +01:00
Max Kellermann
8754d705a1 CommandLine: rename struct options 2021-11-05 08:57:12 +01:00
Max Kellermann
23d4a2d6a5 Main: pass struct options by reference 2021-11-05 08:56:05 +01:00
Max Kellermann
ce77b148d9 CommandLine: add option --systemd
This way, MPD can reliably detect whether it was started as systemd
service, which is better than checking sd_booted(), which only checks
whether systemd manages all services, but still MPD could be started
manually.
2021-11-05 08:51:49 +01:00
Max Kellermann
3413b1aeb4 output/alsa: add option thesycon_dsd_workaround 2021-11-04 17:55:53 +01:00
Max Kellermann
356d13e9dd lib/alsa/HwSetup: add missing include 2021-11-04 17:55:15 +01:00
Max Kellermann
5d0941476a lib/alsa/Error: a std::system_error category for libasound errors 2021-11-04 14:59:00 +01:00
Max Kellermann
5ff0bbd0f8 lib/fmt/AudioFormatFormatter: add formatter for SampleFormat 2021-11-04 14:55:01 +01:00
Max Kellermann
14b3c0f0af event/Loop: destruct the Uring::Manager in the destructor before assert()
Fixes assertion failure when the EventLoop gets destructed before
Run() was ever called.

Fixes https://bugs.debian.org/998310
2021-11-03 18:32:14 +01:00
Max Kellermann
056514d598 output/snapcast: reset unflushed_input after successful read
With the "wave" encoder, this has no effect, but it's more correct.
2021-10-31 16:35:42 +01:00
Max Kellermann
9a21bdfd6a output/snapcast: implement Pause()
This uncomments the code which had been present already in the first
Snapcast commit (copied from the "httpd" output plugin), but I
commented it because I did not know whether I needed to send silence
samples to all Snapcast clients.

As a side effect, this fixes playback when no Snapcast client is
connected; this was broken because Pause() always returned a positive
value when there were no clients.

Closes https://github.com/MusicPlayerDaemon/MPD/issues/1310
2021-10-31 16:26:29 +01:00
Max Kellermann
03f99dd26e db/update/Walk: use GetFilenameSuffix() instead of uri_get_suffix()
Unlike GetFilenameSuffix(), uri_get_suffix() removes the query string
first, which breaks file names with question marks in the name.
Therefore, uri_get_suffix() shall only be applied to remote URIs.

Closes https://github.com/MusicPlayerDaemon/MPD/issues/1316
2021-10-31 13:18:24 +01:00
Max Kellermann
bfb1b641f9 db/update/InotifyUpdate: fix use-after-free bug
Regression by commit 2d8847f428
2021-10-28 13:39:38 +02:00
Max Kellermann
dcd19c0592 config/Path: use StringView::Split() 2021-10-26 12:55:01 +02:00
Max Kellermann
109159e0f7 Permission: use StringView::Split() 2021-10-26 12:25:47 +02:00
Max Kellermann
409b877eea output/ao: include cleanup 2021-10-26 12:20:18 +02:00
Max Kellermann
c5bf7948ff fs/StandardDirectory: use the RUNTIME_DIRECTORY environment variable 2021-10-26 09:30:16 +02:00
Max Kellermann
b9f7127691 fs/StandardDirectory: add GetAppRuntimeDir() 2021-10-26 09:30:16 +02:00
Max Kellermann
1e6f5f012c fs/StandardDirectory: add GetUserRuntimeDir() 2021-10-26 09:30:16 +02:00
Max Kellermann
225d85fd9b fs/StandardDirectory: use "if" with initializer 2021-10-26 09:29:57 +02:00
Max Kellermann
1bb22f118d fs/StandardDirectory: add more pure/const attributes 2021-10-26 09:04:20 +02:00
Max Kellermann
48e8a26813 command/playlist: allow range in playlistdelete 2021-10-25 12:23:37 +02:00
Max Kellermann
ade847bc89 PlaylistFile: fold spl_move_index() into handle_playlistmove() 2021-10-25 12:13:45 +02:00
Max Kellermann
a6173e0eae command/playlist: add position parameter to "playlistadd"
Closes https://github.com/MusicPlayerDaemon/MPD/issues/1106
2021-10-25 12:10:47 +02:00
Max Kellermann
258ecb764f PlaylistFile: add class PlaylistFileEditor 2021-10-23 13:54:50 +02:00
Max Kellermann
6f595e9abb command/queue: add optional position parameter to "add"
Closes https://github.com/MusicPlayerDaemon/MPD/issues/1285
2021-10-23 13:12:44 +02:00
Max Kellermann
35c4c7e8bf command/queue: move #ifdef out of AddDatabaseSelection() 2021-10-23 13:09:04 +02:00
Max Kellermann
293ed924d1 command/queue: pass Partition to AddDatabaseSelection() 2021-10-23 13:06:31 +02:00
Max Kellermann
c8121176b3 output/alsa: add option "stop_dsd_silence" to work around DSD DAC noise 2021-10-23 12:25:32 +02:00
Max Kellermann
ee270f9b00 meson.build: log_dep is only needed internally 2021-10-23 12:08:43 +02:00
Max Kellermann
bf1d77a4d8 output/alsa: un-inline several methods 2021-10-23 12:02:27 +02:00
Max Kellermann
a9344fafe9 lib/alsa/AllowedFormat: use StringView::RemoveSuffix() 2021-10-23 11:43:31 +02:00
Max Kellermann
b8890726f2 lib/alsa/AllowedFormat: use std::string_view 2021-10-23 11:42:30 +02:00
Max Kellermann
0f84332654 output/alsa: make "mode" const 2021-10-23 11:39:59 +02:00
Max Kellermann
46c82259f7 output/Control: make config fields const 2021-10-22 20:22:22 +02:00
Max Kellermann
2d03823283 output/Control: fold Configure() into the constructor 2021-10-22 20:21:58 +02:00
Max Kellermann
bba144eca5 output/Control: use C++ initializers 2021-10-22 20:21:43 +02:00
Max Kellermann
9af73dad93 output/Multiple: remove unused method Add() 2021-10-22 20:21:35 +02:00
Max Kellermann
f0d66bf6a6 output/Control: pass rvalue reference to move constructor 2021-10-22 20:14:37 +02:00
Max Kellermann
5ad53a7554 output/Thread: remove duplicate code by calling InternalCloseOutput() 2021-10-22 19:54:47 +02:00
Max Kellermann
7b2e3331f2 output/Filtered: improve API docs 2021-10-22 19:54:38 +02:00
Max Kellermann
e16109330d input/last: clear "uri" in OnCloseTimer()
Without clearing the "uri" field, the next Open() call attempts to
reuse the old InputStream, but it has already been closed, so Open()
always returns nullptr.

Closes https://github.com/MusicPlayerDaemon/MPD/issues/1300
2021-10-22 12:45:18 +02:00
Max Kellermann
72621531e0 protocol/Result: convert to Client method 2021-10-22 11:55:39 +02:00
Max Kellermann
0a48146efc client/Client: pass std::string_view to Write()
Almost all callers have string literal, and the length is known at
compile time.
2021-10-22 11:54:14 +02:00
Max Kellermann
0c4bf12bfd player/CrossFade: fix inverted check and wrong variable
The inverted check was introduced by commit 46d00dd85f, and commit
8ad17d25ef added a check for the wrong variable.  D'oh!

Closes https://github.com/MusicPlayerDaemon/MPD/issues/1303
2021-10-22 11:49:38 +02:00
Max Kellermann
b8e0855ef3 output/pipewire: obey PipeWire's DSD bit order and interleave
Closes https://github.com/MusicPlayerDaemon/MPD/issues/1297
2021-10-21 21:15:16 +02:00
Max Kellermann
6467502b9d output/pipewire: restore SampleFormat::DSD after ToPipeWireAudioFormat() call 2021-10-21 21:15:13 +02:00
Max Kellermann
15b67f20e5 output/pipewire: un-inline ParamChanged() 2021-10-21 20:11:22 +02:00
Max Kellermann
0825179f00 output/pipewire: add local reference variables 2021-10-21 20:02:59 +02:00
Max Kellermann
97211d0aad output/pipewire: rename field "buffer" to "pod_buffer" 2021-10-21 20:02:32 +02:00