15720 Commits

Author SHA1 Message Date
Max Kellermann
0ba0c64093 event/uring/Manager: add flags parameter 2025-01-29 18:07:46 +01:00
Max Kellermann
5e107c33d9 event/DeferEvent: add ScheduleNext() 2025-01-29 18:05:50 +01:00
Max Kellermann
4bb379a218 event/ServerSocket: use SocketDescriptor::GetPeerCredentials() 2025-01-29 17:56:26 +01:00
Max Kellermann
3710b54d43 event/ServerSocket: pass SocketDescriptor to get_remote_uid() 2025-01-29 17:56:26 +01:00
Max Kellermann
0186f73c7a client/Process: let libfmt quote the command string 2025-01-29 17:32:42 +01:00
gd
88594c81d6 Logging: added seconds to log time string.
Time was only in minutes before.
Seconds is more useful in analyzing the log for example
with issues of timeouts, and reponse times.
2025-01-29 17:31:21 +01:00
Max Kellermann
f6bd49ba61 Merge branch 'tag-compare' of https://github.com/geneticdrift/MPD 2025-01-29 17:21:54 +01:00
Max Kellermann
a404e5754e release v0.23.17
-----BEGIN PGP SIGNATURE-----
 
 iQJEBAABCgAuFiEEA5IzWngIOJSkMBxDI26KWMbbRRIFAmeaU0kQHG1heEBtdXNp
 Y3BkLm9yZwAKCRAjbopYxttFEtYUD/9a1KtdDSVTQAk6flFs71DYEvu1HKPlB51u
 9N2R0yx4dVvFIDEJi+O+I8RK0kfTuEyQFFm9/QzgmB5P7MBWbQH5nHzSINJ6aMlo
 OqeChrlLflGZWPypJQmT+gku80SgfrkRfC1pgVGDjh2a2y++0TQfAtuVlkIZEvl3
 rJ1auKuPGc/3+bM5/WC5zbsQSUrn24iEfh0akfz4tExBd17+DF7JN8IejapnCV1s
 EchsLaCONwxUW4SqeRUoU0OzO6triRFwglYa0pwHKUijHuL9ud5xvW7KVz+c7tTs
 2W5EgZshOyRNCIehV/ZNx9NL0zKM0ehb6//pBPmdZhXBJBsWS1YQzYLgJK+RNXeS
 sWEc1ANNS8R8V5b13sE+8mLwmjgUO6lLsjsuywrS0+ac3b8XeKU8PDqVq+oSZWdK
 jNh0SBN8MJpCLwJ/jFa6q36A+534G4hEV/QG0wvviK+wAf3OLpi3G0++wRyh0RcS
 msQWeoXHcY/nhfgDK2TrUjaJsHjVqqZljNaoiZSdseLFsXt73aTHQ6Eu12GXZNZF
 gxvd3jBGSrR5Zq+tes4oQ8unes/AEqXBN+PtJuLaZYxn8aOhButt6UEyfERO7NJY
 AMQomtwx3TVhpRwz/9LZMvpK4UIbd80i/3zv5w1mxns1LThErXgcEoqbKN86SJmU
 185T/UdrVA==
 =hdJY
 -----END PGP SIGNATURE-----

Merge tag 'v0.23.17'

release v0.23.17
2025-01-29 17:20:02 +01:00
Max Kellermann
0e8cd3b961 client/Process: explicitly disallow "idle" and "noidle" in command lists
These commands cannot possibly work with command lists because command
lists are supposed to be atomic, but suspended command execution
conflicts with that.

Closes https://github.com/MusicPlayerDaemon/MPD/issues/2167
2025-01-29 17:08:53 +01:00
Max Kellermann
8fcb6e148f decoder/list: probe "ffmpeg" before "sndfile" and "audiofile"
For FFmpeg's DTS-WAV support, see code comment.

Closes https://github.com/MusicPlayerDaemon/MPD/issues/2158
2025-01-29 15:42:54 +01:00
gd
ce9ee38304 decoder/Bridge: DecoderBridge::UpdateStreamTag - return false if stream tag not changed.
Some streams send the same tags frequently, causeing unnecessary update
events.
2025-01-29 16:02:20 +02:00
gd
f9d47502d8 player/Thread: update song tag from remote stream only if changed.
Some streams send the same tags frequently, causing unnecessary player queue update events.
2025-01-29 16:00:37 +02:00
gd
f15014b6af tag/Item: made TagItem constructor private and friend TagPoolItem
To only allow construction as part of TagPoolItem with its special var size allocator in TagPoolItem::Create.
2025-01-29 16:00:37 +02:00
gd
2a9c3a2e50 tag/Tag: added operator==(Tag&) 2025-01-29 16:00:37 +02:00
gd
3e9c2cce71 tag/Item: added operator== to TagItem 2025-01-29 16:00:37 +02:00
gd
93bf99f639 util/DereferenceIterator, TerminatedArray: added operator-(const IteratorType&) to DereferenceIterator and TerminatedArray::iterator
It is required by std::distance and some std algos.
2025-01-29 16:00:20 +02:00
Max Kellermann
c0a9434f34 command/file: "albumart" tries to send larger chunks if available
If we only receive very little data from the InputStream, try a second
Read() call to get more data.  This works around tiny reads at input
buffer boundaries with the io_uring input plugin.  These tiny reads
are inefficient, and we can afford to wait one more low-level I/O
iteration to finish (but not more).

Closes https://github.com/MusicPlayerDaemon/MPD/issues/2186
2025-01-29 13:07:05 +01:00
Max Kellermann
d7212624b0 input/{async,thread}: clear the CircularBuffer when it becomes empty
First step towards fixing https://github.com/MusicPlayerDaemon/MPD/issues/2186
2025-01-29 13:05:24 +01:00
Max Kellermann
70a0a781c8 input/async: move the IsEOF() check to a separate block 2025-01-29 12:59:04 +01:00
Max Kellermann
ab011adf77 meson.build: require GCC 12 or clang 14
GCC 10 doesn't have std::make_unique_for_overwrite(), so let's drop it.
2025-01-29 12:24:48 +01:00
Max Kellermann
bd78307940 input/{async,thread}: add an additional Cond field
This eliminates the ScopeExchangeInputStreamHandler kludge.
2025-01-29 12:14:42 +01:00
Max Kellermann
3cc7b7dbf9 Merge branch 'v0.23.x' 2025-01-29 12:09:18 +01:00
Max Kellermann
57e7fb3f62 tag/Id3Load, ...: use std::make_unique_for_overwrite()
Don't zero-initialize the buffers.  This removes some useless
overhead.
2025-01-29 12:01:27 +01:00
Max Kellermann
687475cf3c db/update/InotifyUpdate: handle IN_CREATE without IN_ISDIR
A new symlink causes `IN_CREATE`.  Usually, we catch `IN_CREATE` only with
IN_ISDIR to watch the new directory, but otherwise `IN_CREATE` is not
handled.  Regular files are "created" but they have usable content
only with `IN_CLOSE_WRITE`.  Yet symlinks have only `IN_CREATE` and
they are immediately usable.

Closes https://github.com/MusicPlayerDaemon/MPD/issues/2192
2025-01-29 09:41:08 +01:00
Max Kellermann
c48dbd5dd4 lib/nfs/meson.build: reject libnfs 6
libnfs version 6 has major API changes and MPD 0.23 has never been
adapted to these.  This additional configure-time check fixes
potential compile-time failures.
2025-01-29 09:04:55 +01:00
Max Kellermann
37049aab36 lib/nfs/Connection: remove EnableCloseOnExec() call
SOCK_CLOEXEC has been added to libnfs version 2, and since we require
at least version 4, we can safely remove this call.
2025-01-29 09:02:05 +01:00
Max Kellermann
18495fbb4e lib/nfs/meson.build: require libnfs 4.0
All Linux distributions have at least version 4, and thus I cannot
test with older versions.
2025-01-29 09:00:37 +01:00
Max Kellermann
cdcee16738 client/File: improve error message
Users are confused by "Access denied".  Let's write an error message
that is more clear.

Closes https://github.com/MusicPlayerDaemon/MPD/issues/2184
2025-01-29 08:28:30 +01:00
Max Kellermann
083d39ea80 decoder/plugins/meson.build: add missing dependency to libid3tag 2025-01-28 19:38:50 +01:00
Max Kellermann
a5da7fd51a Merge branch 'v0.23.x' 2025-01-28 19:33:19 +01:00
Max Kellermann
0aeda01ba6 lib/yajl: drop "yajl/" prefix from #include paths
According to the yajl API documentation, #include lines should have
the "yajl/" path prefix, but the actual pkg-config file contains:

 includedir=${dollar}{prefix}/include/yajl

.. which already contains this directory name, and thus the "yajl/"
prefix cannot work.  Unfortunately, the yajl project hasn't been
maintained for nearly 10 years, and there's little chance this bug
will ever be fixed.
2025-01-28 19:27:46 +01:00
Max Kellermann
eb3cd7bed3 subprojects: add lame 2025-01-28 19:13:59 +01:00
Max Kellermann
578c94081f subprojects: add curl 2025-01-28 19:12:57 +01:00
Max Kellermann
2752f67877 lib/nfs/meson.build: add missing dependency on libevent.a 2025-01-28 19:05:09 +01:00
Max Kellermann
f55e0df614 lib/curl/meson.build: add missing internal dependency on libevent.a 2025-01-28 18:52:37 +01:00
Max Kellermann
177ffde90f Merge branch 'v0.23.x' 2025-01-28 18:45:02 +01:00
Max Kellermann
508bfbe334 pipewire/meson.build: add "include_type:system"
This suppresses a compiler warning due to sloppy code in PipeWire:

 /usr/include/spa-0.2/spa/utils/json-core.h:440:29: error: implicit conversion increases floating-point precision: 'float' to 'double' [-Werror,-Wdouble-promotion]
   440 |         return spa_dtoa(str, size, val);
       |                ~~~~~~~~            ^~~
2025-01-28 18:34:12 +01:00
Max Kellermann
1385212572 io/uring/meson.build: detect liburing with include_type=system
This avoids breakages due to `-Wgnu-anonymous-struct`.
2025-01-28 18:34:07 +01:00
Max Kellermann
75d0914373 Merge branch 'fix-handle-status' of https://github.com/geneticdrift/MPD 2025-01-28 06:18:19 +01:00
Max Kellermann
35dc1fc589 io/UniqueFileDescriptor: use AdoptTag in the constructors that adopt ownership 2025-01-23 16:57:39 +01:00
Max Kellermann
765a6a2f20 net/UniqueSocketDescriptor: use AdoptTag in the constructors that adopt ownership
This makes it a little bit harder to use the ownershop-adopting
constructors accidently.
2025-01-23 16:56:57 +01:00
Max Kellermann
131263cbe3 util/TagStructs: add struct AdoptTag 2025-01-23 16:56:00 +01:00
Max Kellermann
936611b47c util/ShallowCopy: rename header to TagStructs.hxx
This new header will be a collection of more structs like ShallowCopy.
2025-01-23 16:55:51 +01:00
gd
266eb393eb fix: output of command status broken by a misplaced comma in the format arguments 2025-01-21 14:03:41 +02:00
Michael Herstine
194ecd69e0 lib/fmt: remove even more now-broken uses of FMT_STRING
MPD stopped building since fmt 11.1.0; see
<https://github.com/fmtlib/fmt/issues/4304>. The first commit
fixing this was 9db7144, followed by 5de0909 (both on the
unstable branch).

This commit removes what the author believes to be the remaining
uses in the MPD codebase.
2025-01-20 19:54:41 -08:00
Michael Herstine
b24b3c1054 Merge remote-tracking branch 'upstream/v0.23.x' 2025-01-20 09:44:07 -08:00
Alfred Wingate
5de0909ae5
lib/fmt: remove the rest of the broken use of FMT_STRING
Fixes: 9db7144d0fa4512335070a984690f3f5034210a5
Signed-off-by: Alfred Wingate <parona@protonmail.com>
2025-01-18 03:29:14 +02:00
Rudi Heitbaum
da6efd6361 plugins/meson.build: revert unintentional static link change
Minor revert of 9db7144d0fa4512335070a984690f3f5034210a5
- no change was to be done to meson.build.
2025-01-13 22:39:12 +00:00
Rudi Heitbaum
9db7144d0f lib/fmt: drop use of FMT_STRING
When compiling with libfmt-11.1.0 and newer the following compile errors occur:

In file included from ../src/decoder/DecoderPrint.cxx:23:
../src/client/Response.hxx: In instantiation of 'bool Response::Fmt(const S&, Args&& ...) [with S = decoder_plugin_print(Response&, const DecoderPlugin&)::<lambda()>::FMT_COMPILE_STRING; Args = {const char* const&}]':
../src/decoder/DecoderPrint.cxx:38:7:   required from here
   38 |         r.Fmt(FMT_STRING("plugin: {}\n"), plugin.name);
      |         ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../src/client/Response.hxx:86:28: error: cannot convert 'const decoder_plugin_print(Response&, const DecoderPlugin&)::<lambda()>::FMT_COMPILE_STRING' to 'fmt::v11::string_view' {aka 'fmt::v11::basic_string_view<char>'}
   86 |                 return VFmt(format_str,
      |                        ~~~~^~~~~~~~~~~~
   87 |                             fmt::make_format_args(args...));
      |                             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../src/client/Response.hxx:81:36: note: initializing argument 1 of 'bool Response::VFmt(fmt::v11::string_view, fmt::v11::format_args)'
   81 |         bool VFmt(fmt::string_view format_str, fmt::format_args args) noexcept;
      |                   ~~~~~~~~~~~~~~~~~^~~~~~~~~~
../src/client/Response.hxx: In instantiation of 'bool Response::Fmt(const S&, Args&& ...) [with S = decoder_plugin_print(Response&, const DecoderPlugin&)::<lambda()>::FMT_COMPILE_STRING; Args = {const char* const&}]':

The error is due to the use of FMT_STRING. The libfmt team shared the following:

    The correct way of using FMT_STRING is to wrap a format string when passing to a
    function with compile-time checks (i.e. that takes format_string) as documented
    in https://fmt.dev/11.1/api/#legacy-compile-time-checks.

    Noting that FMT_STRING is a legacy API and has been superseded by consteval-based
    API starting from version 8: https://github.com/fmtlib/fmt/releases/tag/8.0.0. It
    looks like MPD is trying to emulate {fmt}'s old way of implementing compile-time
    checks which was never properly documented because it was basically a hack. So the
    correct fix is to switch to format_string and, possibly, remove usage of FMT_STRING.

    The old way of doing compile-time checks (fmt::make_args_checked) was documented
    in https://fmt.dev/7.1/api.html#argument-lists but it looks like MPD is not using
    that API so the problematic uses of FMT_STRING have no effect and can just be removed.

The FMT_STRING has been removed in this change based on the fmt-7.1 API and now MPD is
successfully compile against the current libfmt-11.1.0 which highlighted the issue that
had been present in the codebase as it is now triggering the error, is legacy and was
not using the API for which FMT_STRING was aligned with.
2025-01-13 06:17:01 +00:00
jcorporation
bd36b5e310 Response with error for sticker set,inc,dec and add missing asserts 2024-12-12 19:40:06 +01:00