15720 Commits

Author SHA1 Message Date
Camille Scholtz
30e1cbbcba fs/glue/StandardDirectory: Add standard directories for macOS 2025-03-14 08:25:30 +01:00
Camille Scholtz
86ab4bc62c config/Path: Always allow getting of XDG... variables 2025-03-13 22:22:14 +01:00
Camille Scholtz
a34bf3588e fs/glue/StandardDirectory: Remove double import 2025-03-13 22:21:15 +01:00
Max Kellermann
3626d4ec9a Revert "lib/icu/Compare: add LINGUISTIC_IGNORECASE [Windows]"
This reverts commit 1bd204527e010a59a375903d7c03cfe68c788d74.  This
fixes a test on WINE, but fails many others on Windows.  D'oh!
2025-03-13 11:22:02 +01:00
Max Kellermann
1bd204527e lib/icu/Compare: add LINGUISTIC_IGNORECASE [Windows]
This fixes one check in the "StringFilterTest.Normalize" unit test.
2025-03-13 10:35:42 +01:00
Max Kellermann
dd59db2be2 fs/LookupFile: check for empty file name on Windows
Fixes crash bug in the (synthetic) unit test.  See code comment.
2025-03-13 09:21:04 +01:00
Max Kellermann
c290e0b965 LogBackend: remove the colon after the time stamp
This colon with spaces around it looked weird and was somewhat
redundant.  Let's use a space only.  This looks better if we replace
the space between date and time with a 'T', so it's mostly the ISO8601
format only in local time instead of UTC.
2025-03-13 09:02:01 +01:00
Max Kellermann
689d231809 LogBackend: include year in time stamp
Also use a numeric month instead of the month name.
2025-03-13 09:00:37 +01:00
Max Kellermann
84ff3c6a0d LogBackend: use %T 2025-03-13 08:58:36 +01:00
Max Kellermann
093122aaeb LogBackend: use fmt to format the time stamp 2025-03-13 08:57:23 +01:00
Max Kellermann
4f981adb97 lib/fmt/Unsafe: new library 2025-03-13 08:55:12 +01:00
Max Kellermann
3945b808a2 CommandLine: update copyright year 2025-03-13 08:30:28 +01:00
Max Kellermann
a171a588cf queue/QueuePrint: switch to SPDX header 2025-03-13 08:30:28 +01:00
Jzavrk
dac2c4df9b output/plugins/SndioOutputPlugin: Fix sndio volume calculation
This commit addresses issues  and .
MPD and sndio volume ranges being different, the formula to transform a
value from one set to the other is in the form of `(a * x + b) / c`
where:
 - a = output set max value
 - b = adjustment term
 - c = input set max value
Previous calculation formula had `b = 0`, scaling values too low and
rendering increment impossible. Having `b = out_maxval / 2` balances the
transformation, ensuring a better spread of values across the output
range.

Closes 
2025-03-12 12:24:00 +01:00
Max Kellermann
843cb1604d net: delete UniqueSocketDescriptor.hxx.orig
This got committed accidently.
2025-03-11 17:16:58 +01:00
Max Kellermann
1c7c2026db config/Path: check for empty XDG variables 2025-03-11 09:23:33 +01:00
Max Kellermann
a9805db500 config/Path: move code to GetVariable() 2025-03-11 09:19:20 +01:00
Max Kellermann
e8a4317f31 config/Path: simplify tilde expansion 2025-03-11 09:17:01 +01:00
Max Kellermann
f4f5e94a36 config/Path: pass std::string_view to ParsePath() 2025-03-11 09:15:18 +01:00
Max Kellermann
1dc8cd8eef config/Path: allow expanding $HOME even without XDG 2025-03-11 08:45:04 +01:00
Max Kellermann
147fe18ad6 config/Path: adjust error message (not an environment variable) 2025-03-11 08:44:18 +01:00
Max Kellermann
6fd6a5110c config/Path: use string_view literals 2025-03-11 08:36:57 +01:00
JoanVC
e8ce417150
Initial support for $HOME and some XDG variables inside the configuration file
This commit tries to address issues  and . It enables the path expansion of HOME, XDG_CONFIG_HOME, XDG_MUSIC_DIR, XDG_CACHE_HOME and XDG_RUNTIME_DIR by using the glue functions already available in MPD.

Signed-off-by: Joan Vilardaga <github-91yu@joanvc.cat>
2025-03-10 22:21:03 +01:00
Max Kellermann
da40483666 event/Loop: destroy the UringWake instance in DisableUring() 2025-03-10 19:14:10 +01:00
Max Kellermann
06bc373ace event/Loop: read eventfd with io_uring
This eliminates a roundtrip to epoll.
2025-03-10 18:59:08 +01:00
Max Kellermann
7797158ea6 event/Loop: auto-restart io_uring_prep_poll_multishot()
Applications need to check the `IORING_CQE_F_MORE` flag to see whether
the kernel is still polling, or whether it has stopped for some reason.
2025-03-10 18:52:31 +01:00
Max Kellermann
01a04baf7b util/DivideString: remove unused library 2025-03-10 18:35:20 +01:00
Max Kellermann
46b461df42 playlist/pls: migrate the line parser to use std::string_view 2025-03-10 18:35:20 +01:00
Max Kellermann
898e0a2bc4 test/playlist: unit tests for the playlist plugins
Only "pls" for now.
2025-03-10 18:35:20 +01:00
Max Kellermann
2d3271859f input/memory: new implementation (for unit tests) 2025-03-10 18:17:33 +01:00
Max Kellermann
b6672004bc util/StringCompare: add SkipPrefixIgnoreCase() 2025-03-10 18:17:33 +01:00
Max Kellermann
eafca183a6 input/meson.build: add libinput_basic.a
This is the middle ground between libinput_api.a (the raw API) and
libinput_glue.a (dependencies on all plugins).
2025-03-10 17:13:51 +01:00
Max Kellermann
59f9e0ca70 input/meson.build: do not compile ProxyInputStream.cxx twice 2025-03-10 17:11:12 +01:00
Max Kellermann
800a03f0dc playlist/plugins/meson.build: add missing dependencies 2025-03-10 14:33:41 +01:00
Max Kellermann
55c11448ff util/NumberParser: add ParseIntegerTo()
An version of the function without the `std::optional` overhead.
2025-03-10 14:04:50 +01:00
Max Kellermann
e9c1ea684b util/NumberParser: add std::from_chars() wrapper taking std::string_view 2025-03-10 14:04:50 +01:00
Max Kellermann
103487e8ad event/InotifyEvent: add method IsDefined() 2025-03-10 14:04:50 +01:00
Max Kellermann
4cefb30dd9 decoder/flac: ignore FLAC__STREAM_DECODER_END_OF_LINK (FLAC 1.5)
Fixes -Wswitch compiler warning when building with FLAC 1.5.

Closes https://github.com/MusicPlayerDaemon/MPD/issues/2219
2025-02-28 10:32:47 +01:00
Jochen Sprickerhof
d822685c53
config/File: support resetting repeatable params
This allows resetting bind_to_address to override the default value in a
included config.
2025-02-21 13:52:44 +01:00
Max Kellermann
85014b5fa2 event/Loop: move code to Wait() 2025-02-13 16:54:36 +01:00
Max Kellermann
aff929dbd6 event/Loop: rename Wait() to Poll()
Preparing to have another Wait() method wrapping Poll() and io_uring.
2025-02-13 16:53:49 +01:00
Max Kellermann
dda85e02bf io/Open: add TryOpen(struct open_how), Open(struct open_how) 2025-02-13 16:09:12 +01:00
Max Kellermann
5b393052ee event/Loop: pass timeout=nullptr to io_uring if there is no timer 2025-02-13 16:04:07 +01:00
Max Kellermann
624da8ce5b event/Loop: use io_uring_prep_poll_multishot() on the epoll fd
This wraps epoll and io_uring the other way: previously, we had the
io_uring file descriptor registered in epoll and when it became ready,
we could query its completion ring.  The problem is that the poll
wakeups cause considerable overhead in the Linux kernel, see
https://lore.kernel.org/io-uring/20250128133927.3989681-9-max.kellermann@ionos.com/

By wrapping epoll inside io_uring using
io_uring_prep_poll_multishot(), the "outer" loop is io_uring and
inside it, we have epoll.  This adds another system call for epoll,
but that will go away as soon as most operations are going through
io_uring.  Previously, io_uring had this extra system call.
2025-02-13 16:02:40 +01:00
Max Kellermann
bca9e3e347 io/uring/Queue: dispatch all completions in SubmitAndWaitDispatchOneCompletion()
io_uring_submit_and_wait_timeout() can return multiple completions,
even if we wait for only one.  We should dispatch them all or we miss
wakeups.
2025-02-13 14:53:30 +01:00
Max Kellermann
2276ebd70f io/uring/Queue: add DispatchCompletions() overload using io_uring_for_each_cqe() 2025-02-13 14:53:24 +01:00
Max Kellermann
a9bee1c64b io/uring/Ring: add io_uring_for_each_cqe() wrapper 2025-02-13 14:53:17 +01:00
Max Kellermann
c8e88408b2 io/uring/Ring: ignore EINTR 2025-02-13 14:53:11 +01:00
Max Kellermann
45644759fe io/uring/CancellableOperation: invoke OnUringCompletion() in destructor
This is important for operations that have complex cancellation
procedures (e.g. if they need to free buffers).  They might leave an
Operation instance in the queue.
2025-02-13 14:52:52 +01:00
Max Kellermann
e014d31972 io/uring/Ring: add io_uring_submit_and_wait_timeout() wrapper 2025-02-13 14:52:37 +01:00