Commit Graph

16855 Commits

Author SHA1 Message Date
Max Kellermann 05f529fffd util/StringStrip: use [[gnu::...]] attributes 2021-11-26 16:24:55 +01:00
Max Kellermann f01388559f .github/workflows/build.yml: fix the ccache.key 2021-11-26 13:32:48 +01:00
Max Kellermann 27edd4a610 .github/workflows: merge build-{linux,macos}.yml into one 2021-11-26 13:32:08 +01:00
Max Kellermann cc421b04cd test/meson.build: add "protocol:gtest" where appropriate 2021-11-26 08:47:06 +01:00
Max Kellermann 3f2bc325a1 test/meson.build: fix test() indent 2021-11-26 08:40:40 +01:00
Max Kellermann 54686dfd79 test/meson.build: add dependencies on run_input
Fixes spurious unit test failures because run_input has not yet been
built.
2021-11-26 08:35:49 +01:00
Rosen Penev f22cf02ed8 fix wrong namespace name
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2021-11-26 08:08:45 +01:00
Rosen Penev 5b51d0f733 use some auto
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2021-11-26 08:08:45 +01:00
Rosen Penev e03f82636a const reference conversion
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2021-11-23 12:33:03 -08:00
Rosen Penev d53d85bd79 remove unused includes
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2021-11-23 12:33:03 -08:00
Max Kellermann 4682ae0898 command/database: support relative offsets for "searchadd"
Closes https://github.com/MusicPlayerDaemon/MPD/issues/1337
2021-11-23 12:17:32 +01:00
Max Kellermann fd5b195879 .github/workflows/build-macos.yml: use actions/setup-python@v1
Without it, BSFishy/meson-build defaults to /usr/local/bin/python,
which is Python 2.
2021-11-23 12:17:32 +01:00
Max Kellermann bb5df9839d .github/workflows/build-macos.yml: install Meson, ninja and Boost 2021-11-23 12:17:32 +01:00
Max Kellermann be34d55291 .github/workflows: add macOS build 2021-11-23 11:41:40 +01:00
Max Kellermann c13911b171 .github/workflows: auto-build with GitHub Actions 2021-11-23 10:45:14 +01:00
Max Kellermann 6f83bdd6f3 Merge branch '1' of git://github.com/neheb/MPD 2021-11-23 10:39:07 +01:00
Rosen Penev 9bcd425a85 array conversions
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2021-11-23 01:38:10 -08:00
Max Kellermann ec917f70d2 Merge remote-tracking branches 'neheb/2' and 'neheb/3' 2021-11-23 09:23:43 +01:00
Rosen Penev 40ce4eeb43 use cinttypes header
stdint.h is deprecated.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2021-11-22 23:30:36 -08:00
Rosen Penev 29ae84e199 manual braced init
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2021-11-22 23:30:04 -08:00
Rosen Penev 250011f016 return by braced init list
shorter

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2021-11-22 23:28:08 -08:00
Max Kellermann e08c85ae2d doc/mpd.conf.5.rst: move ReplayGain documentation to user.rst 2021-11-22 22:25:04 +01:00
Max Kellermann dcb5ca203c db/DatabasePlaylist: increment only one variable
Fixes "searchaddpl" bug emitting bogus error "Bad position".

Closes https://github.com/MusicPlayerDaemon/MPD/issues/1338
2021-11-22 20:47:34 +01:00
Max Kellermann 77df5a8f24 lib/pcre: migrate to PCRE2
Closes https://github.com/MusicPlayerDaemon/MPD/issues/1352
2021-11-22 19:32:45 +01:00
kaliko d6bebd2507 doc/conf.py: Set sidebar width to 300px to limit wrapping
This enhances readability in sidebar, especially for "User’s Manual" and
"Protocol" pages
2021-11-20 10:49:15 +01:00
Max Kellermann f74996c02f Merge remote-tracking branches 'neheb/1', 'neheb/2', 'neheb/3', 'neheb/4' and 'neheb/5' 2021-11-20 07:55:24 +01:00
Max Kellermann eea2d35d3a util/AllocatedString, ...: add missing include for std::exchange()
Fixes building with GCC 12.
2021-11-19 16:06:20 +01:00
Max Kellermann d94e8bd82d queue/IdTable: include cleanup 2021-11-19 16:03:09 +01:00
Max Kellermann b0c92e1a34 queue/IdTable: lazy-initialize the "data" array
With large "max_playlist_length" settings, the "data" array can be
very large, and initializing it during MPD startup causes page faults,
resulting in allocation of physical RAM.  This commit postpones the
initialization until the queue is really large, to avoid wasting
memory.
2021-11-19 16:00:39 +01:00
Max Kellermann ead5bcf048 queue/IdTable: make size const 2021-11-19 15:51:10 +01:00
kaliko bdd268a524 doc/user.rst: update build dependencies on Debian Bullseye 2021-11-19 11:04:47 +01:00
Shen-Ta Hsieh e783c2bd2c
util/LazyRandomEngine: use std::optional to avoid allocation
Signed-off-by: Shen-Ta Hsieh <ibmibmibm.tw@gmail.com>
2021-11-14 03:53:42 +08:00
Rosen Penev 837fc98638 use const references
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2021-11-11 17:18:33 -08:00
Rosen Penev 5deca66fdc add various nodiscard
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2021-11-11 17:17:26 -08:00
Rosen Penev cfe2dd4147 use nullptr
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2021-11-11 17:16:19 -08:00
Rosen Penev 00f8d65a17 remove std::move
clang-tidy reports this is trivially copyable and thus std::move has no
effect.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2021-11-11 17:15:21 -08:00
Rosen Penev 4e0e4c00bf treewide: replace lock_guard with scoped_lock
SonarLint reports the latter to be better:

std::scoped_lock basically provides the same feature as std::lock_guard,
but is more generic: It can lock several mutexes at the same time, with a
deadlock prevention mechanism (see {rule:cpp:S5524}). The equivalent code
to perform simultaneous locking with std::lock_guard is significantly more
complex. Therefore, it is simpler to use std::scoped_lock all the time,
even when locking only one mutex (there will be no performance impact).

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2021-11-11 17:13:03 -08:00
Max Kellermann a8c77a6fba Merge branch '1' of git://github.com/neheb/MPD 2021-11-11 10:33:17 +01:00
Rosen Penev 31aa6d0c4f use auto with make_unique
C arrays can be used with make_unique in C++17.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2021-11-11 01:33:03 -08:00
Max Kellermann d051c4931d Merge branch '2' of git://github.com/neheb/MPD 2021-11-11 10:32:45 +01:00
Rosen Penev 94b0baceb0 convert address_family_ranking to std::array
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2021-11-11 01:27:31 -08:00
Max Kellermann 16feb261e2 increment version number to 0.23.5 2021-11-11 10:18:19 +01:00
Max Kellermann f084bf7872 release v0.23.4 2021-11-11 10:16:36 +01:00
Max Kellermann 1112d3907a Revert "systemd: add "RuntimeDirectory" directive"
This reverts commit 552c30eae4.

It has caused various problems; for example, MPD wasn't able to write
the pid_file (which was already mitigated by commit a4e4217204).

And apparently, the socket file created in the same directory by
mpd.socket disappears when mpd.service (re)creates the directory.  I
could not reproduce this problem with 247.3, but maybe this is a bug
in older systemd versions?

Until we figure out why this happens, let's remove the
RuntimeDirectory directive.  A future MPD version may be launched as
regular user, not as root, which will eliminate one major problem with
RuntimeDirectory.
2021-11-11 10:16:13 +01:00
Max Kellermann 3464497880 command/database: add optional position parameter to "searchaddpl"
Closes https://github.com/MusicPlayerDaemon/MPD/issues/1328
2021-11-11 09:52:49 +01:00
Max Kellermann 651f57bced command/playlist: save only if at least one song was added 2021-11-11 09:50:31 +01:00
Max Kellermann b4e72aba6c command/playlist: move code to SearchInsertIntoPlaylist() 2021-11-11 09:40:41 +01:00
0xC0ncord 061dd2dfef output/plugins: fix build error with clang and -stdlib=libc++
This fixes this build error observed with clang and -stdlib=libc++:

../mpd-0.23.3/src/output/plugins/PipeWireOutputPlugin.cxx:661:55: error: implicit instantiation of undefined template 'std::array<std::byte, 64>'
        std::array<std::byte, MAX_CHANNELS * MAX_INTERLEAVE> buffer;
                                                             ^
/usr/include/c++/v1/__tuple:219:64: note: template is declared here
template <class _Tp, size_t _Size> struct _LIBCPP_TEMPLATE_VIS array;
                                                               ^
2021-11-10 15:35:56 -05:00
Max Kellermann 5f4ec7de5b decoder/ffmpeg, lib/ffmpeg: make AVCodec pointers "const"
For libavcodec 59 support.

Closes https://github.com/MusicPlayerDaemon/MPD/issues/1333
2021-11-09 21:09:14 +01:00
Max Audron 6f81bb4b09 upnp: add option to configure interface for db plugin
Add an option to the UPnP database plugin to configure which interface
is used by upnp to discover servers.

upnp by default selects the first interface that is not loopback, which
in some cases might not be the desired interface. For example if wanting
to access a DLNA server over a VPN connection.

The "interface" option can now be set to the name of the desired
interface to achieve this.

The default behaviour remains unchanged.
2021-11-08 23:04:07 +01:00