Max Kellermann
9d910320f3
archive/zzip: pass std::shared_ptr as template parameter
...
This eliminates a tiny amount of overhead because the compiler can
choose how to pass the parameter.
2020-09-04 14:33:44 +02:00
Max Kellermann
c53074efc9
archive/zzip: add explicit
2020-09-04 14:33:11 +02:00
Max Kellermann
0aa0ffb67b
decoder/sndfile: allow partial reads at end of file
...
While libsndfile doesn't like partial reads in the middle of a file
(see commit 95ac6071b9
), it allows partial reads at the end of a file.
It doesn't pay attention to the file size when issuing a read.
Commit ecb67a1ed1
(MPD 0.18.12) was a regression: previously,
partial reads at the end of a file were possible, but switching to
decoder_read_full() made this an error condition. This way, a portion
at the end of each file was lost, leading to corruption with gapless
playback (https://github.com/MusicPlayerDaemon/MPD/issues/936 ).
This fix switches to the newly introduced function
decoder_read_much(), which does the same as the code before commit
ecb67a1ed1
.
Closes https://github.com/MusicPlayerDaemon/MPD/issues/936
2020-09-04 13:35:00 +02:00
Max Kellermann
33f70931dd
decoder/API: add decoder_read_much()
2020-09-04 13:35:00 +02:00
Max Kellermann
8830ea319f
decoder/API: add noexcept
2020-09-04 13:35:00 +02:00
Johann Uhrmann
38498d3ee2
Removed duplicate check for negative song time
2020-08-23 12:17:10 +02:00
Max Kellermann
ddb524b6b2
input/uring: add noexcept
2020-08-14 16:45:00 +02:00
Max Kellermann
cbcdc73f9a
system/ByteOrder: add noexcept
2020-08-14 16:36:24 +02:00
Max Kellermann
4f6c54ecb3
output/osx: catch kAudioDevicePropertyHogMode errors
...
Our AudioObjectGetPropertyDataT() wrapper throws exception on error,
and calling it from OSXOutput::Disable() can cause MPD crash due to
std::terminate().
Closes https://github.com/MusicPlayerDaemon/MPD/issues/932
2020-08-14 16:33:43 +02:00
Max Kellermann
dbdf782e59
net/{Resolver,HostParser}: include <cstring>
...
Fixup after e4dad42ca1
2020-07-23 17:40:29 +02:00
Max Kellermann
f102cbb613
net/AllocatedSocketAddress: add missing forward declaration
2020-07-23 17:40:29 +02:00
Max Kellermann
5522967286
net/StaticSocketAddress: add IWYU pragma
2020-07-23 17:40:29 +02:00
Max Kellermann
a2f42e6424
time/ISO8601: use <cstdlib>
2020-07-23 16:26:18 +02:00
Max Kellermann
bdfe6c2c45
lib/dbus/Values: use using
instead of typedef
2020-07-23 16:26:18 +02:00
Max Kellermann
5e1a2e2a93
lib/dbus/Values: add uint32_t
and uint64_t
support
2020-07-23 16:26:18 +02:00
Max Kellermann
7376f31c97
lib/dbus/Message: add noexcept
2020-07-23 16:26:18 +02:00
Max Kellermann
155fc8fa5a
include cleanup
2020-07-23 16:26:18 +02:00
Max Kellermann
7daf80a0c0
util/RuntimeError: add IWYU pragma
2020-07-23 16:10:28 +02:00
Max Kellermann
eb87c28225
util/CharUtil: fix doc typo
2020-07-23 16:08:52 +02:00
Rosen Penev
c876d6a51c
lib/icu: fix build without libc iconv support
...
Need to check for it in iconv.h. Otherwise meson prefixes a __builtin variant in the check.
2020-07-23 14:09:43 +02:00
Max Kellermann
47f54b5650
input/smbclient: close handle on stat error
2020-07-20 22:43:49 +02:00
Max Kellermann
fbfa1723e7
lib/smbclient/Mutex: remove obsolete library
2020-07-20 22:40:27 +02:00
Max Kellermann
a74140842c
storage/smbclient: add Mutex attribute
...
This per-object Mutex replaces the global `smbclient_mutex`.
2020-07-20 22:39:59 +02:00
Max Kellermann
f5a85a816c
storage/smbclient: store SmbclientStorage reference
2020-07-20 22:37:11 +02:00
Max Kellermann
2a15fafbd7
input/smbclient: remove mutex locking
...
This is no longer necessary with the new API.
2020-07-20 22:34:56 +02:00
Max Kellermann
2fc4802886
neighbor/smbclient: remove mutex locking
...
This is no longer necessary with the new API.
2020-07-20 22:32:59 +02:00
Max Kellermann
bb3f487ee5
lib/smbclient/Context: add global Mutex for smbc_{new,free}_context()
...
Preparing to replace `smbclient_mutex`, for finer-grained locking.
2020-07-20 22:32:00 +02:00
Max Kellermann
7d97d0ae87
lib/smbclient/Init: move code to SmbclientContext::New()
...
We no longer need to call smbc_init() because we don't need the compat
layer anymore.
2020-07-20 22:23:18 +02:00
Max Kellermann
f6dc9bcad6
*/smbclient: use the new API with SMBCCTX parameter
...
As a side effect, the input plugin closes the SMB/CIFS connection
after closing the file.
This solves one part of
https://github.com/MusicPlayerDaemon/MPD/issues/916
2020-07-20 22:05:05 +02:00
Max Kellermann
697531a948
lib/smbclient/Context: new wrapper for SMBCCTX
2020-07-20 22:01:10 +02:00
Max Kellermann
3c745b4bc6
neighbor/smbclient: remove obsolete commented code
2020-07-20 18:13:38 +02:00
Max Kellermann
448b397cb8
output/sles: support floating point samples
...
According to https://developer.android.com/ndk/guides/audio/opensl/android-extensions
This feature was mentioned in https://github.com/MusicPlayerDaemon/MPD/issues/922
2020-07-20 15:23:50 +02:00
Max Kellermann
64a1386eb6
output/sles: move SampleFormat selection to switch/case block
2020-07-20 14:47:36 +02:00
Max Kellermann
cf674e9273
input/Init: downgrade PluginUnconfigured to LogLevel::DEBUG
...
`LogLevel::INFO` is logged by default, but this message shall only
appear with `--verbose`.
This finally solves https://github.com/MusicPlayerDaemon/MPD/issues/430
2020-07-16 13:19:14 +02:00
Max Kellermann
b74a91427d
release v0.21.25
...
-----BEGIN PGP SIGNATURE-----
iQJEBAABCgAuFiEEA5IzWngIOJSkMBxDI26KWMbbRRIFAl8DfoEQHG1heEBtdXNp
Y3BkLm9yZwAKCRAjbopYxttFEgVqD/0X+QAV77Pw+RDP7qPtyYDfBH6jOvSpAmHm
moXIFMBaPeIrAFd6jfYTL+JMcVf+jfS6H86JlrWVz5/jerV0St/LxwrTGRqkac8K
OFDmMl2SE2KkniLOTHC2nKq3RFzAKDKK8uCaw3JFpXiAezuRXutX19nHitbau+HC
jD+2Ybyy149fPAB+D6aON6vjZI9hQyyeGoEbducZ5uZz+tvzwY0w1KcnDlaicjJq
Wdu16RFFZNXJnrXQ8hPWTxltgIdRfc9xMrIkydsyQkpW5jLZAJn9Yvl4xIQJhJlb
HlF2/xAUAIqykDqjbxWGnQYywOtCh12XDdn2S2AzAGgNH0z++EBiMyQjLorHf3Eo
wSa/qvi1E5rf8WBCaz3Qa/oa9trj4TQcQFQ+v9esO/yBn3O0K6oGr67P45f1KRqg
SAwnwd+YwYp838lT+MlueD+c67QAY64qCYjI810o3rZ3cyEitWKF6kkvwfzqCfly
HeZJS7OsG1UoxInSfnYwJW1svwtkfZU0WqWHxqKSL/MnwihXhlkhkom8jIS+yYcO
pVPllLvF1H0d/Y2Eb2MH6OKZF+7c5cwSeXJzA808NwzE5dpL2tHAgjxhS/P66voF
/UqLyXySqEaUijp9hW3jEeFJ5TSP2bCaNXnbsQUoM4uqjhkoUi9QLTJIqyG1PKmM
3JKzuZXy2g==
=eK6Y
-----END PGP SIGNATURE-----
Merge tag 'v0.21.25'
release v0.21.25
2020-07-06 21:47:30 +02:00
Max Kellermann
00789de7d4
db/upnp/Object: root nodes are allowed to omit parent_id and name
...
This fixes compatibility with Plex DLNA.
Closes https://github.com/MusicPlayerDaemon/MPD/issues/851
2020-07-06 21:36:30 +02:00
Max Kellermann
9964a5ffe8
db/update/Service: avoid copying the mount point path
2020-07-06 21:09:58 +02:00
Max Kellermann
5ece9685c2
PluginUnavailable: backport class PluginUnconfigured from master
...
Stop bothering people about the Tidal/Qobuz plugins.
2020-07-06 21:08:22 +02:00
Max Kellermann
e7c5a42821
Log: add Log() and LogFormat() overloads with std::exception_ptr
...
Make LogError()/FormatError() wrappers for those. Now we can log
exceptions with a lower level.
2020-07-06 21:08:04 +02:00
Max Kellermann
36e6079c57
Log: make LogLevel the first parameter
...
Prepare for templated functions.
2020-07-06 21:07:26 +02:00
Max Kellermann
e5f23678ca
Log: use GetFullMessage() to print exceptions
...
Print all nested exceptions on a single line to avoid confusion.
2020-07-06 21:07:16 +02:00
Max Kellermann
c3cfb5fe16
Merge branch 'v0.21.x'
2020-07-06 20:56:52 +02:00
Max Kellermann
749ad7cd83
PluginUnavailable: inherit the base class constructor
2020-07-06 20:40:25 +02:00
Max Kellermann
fe48e5596f
command/storage: automatically scan new mounts
...
Closes https://github.com/MusicPlayerDaemon/MPD/issues/841
2020-07-06 20:23:41 +02:00
Max Kellermann
d7744d2b8e
command/storage: check if storage is already mounted
...
Mounting one storage URI twice on different mount points can lead to
conflicts with the database cache file, and it doesn't make a lot of
sense.
But most importantly, our udisks storage plugin will unmount the disk
from the kernel VFS, and if two exist, they will compete with each
others. We could (and should) fix this in the udisks storage plugin,
but for now, this workaround is good enough (and useful).
2020-07-06 18:02:47 +02:00
Max Kellermann
33ee35ab92
command/storage: check if mount point is busy
...
When mounting something over a directory that is already a mount
point, CompositeStorage::Mount() silently overwrites the previously
mounted storage, disposing it. After that, SimpleDatabase::Mount()
will fail and handle_mount() will roll back the
CompositeStorage::Mount() command, effectively unmounting what was
there before (and also leaking memory).
Closes https://github.com/MusicPlayerDaemon/MPD/issues/918
2020-07-06 17:49:38 +02:00
Max Kellermann
5b291ff768
db/update/Walk: pass concatenated .mpdignore URI to storage.MapUTF8()
...
Fixes the "Unrecognized URI" error with the udisks storage plugin,
which is caused by the kludge in UdisksStorage::MapUTF8().
2020-07-06 17:19:38 +02:00
Max Kellermann
39d6816a6d
neighbor/upnp: roll back changes if DoOpen() fails
2020-07-06 16:23:58 +02:00
Max Kellermann
6517b2d2ac
neighbor/upnp: remove D-Bus filter and match in Close()
...
Fixes use-after-free crash bug during MPD shutdown.
2020-07-06 16:15:18 +02:00
Max Kellermann
bfdf13dca3
decoder/Plugin: allow scan_{file,stream}() to throw
...
Bug #915 is about an I/O exception thrown where none was allowed,
leading to crash via std::terminate(). However, instead of catching
and logging the error inside the decoder plugin, it should be able to
propagate the I/O error to the MPD core, so MPD can avoid trying other
decoder plugins.
Closes https://github.com/MusicPlayerDaemon/MPD/issues/915
2020-07-06 14:13:34 +02:00
Max Kellermann
86823af685
Merge branch 'v0.21.x'
2020-07-02 15:34:16 +02:00
Max Kellermann
daefc61aa4
output/osx: postpone start until the end of Play()
...
Wait until there is data in the ring buffer.
2020-07-02 15:26:38 +02:00
Max Kellermann
6fed6e50e4
output/osx: merge some duplicate code
2020-07-02 15:25:51 +02:00
Max Kellermann
bc9e074822
output/osx: postpone start until the first Play() call
...
Wait until there is some data; don't let our render callback be
invoked without any data.
2020-07-02 15:21:54 +02:00
Max Kellermann
8047102542
output/osx: don't restart AudioUnit at the end of Cancel()
...
We shouldn't restart the AudioUnit while the ring buffer is empty, or
else our render callback may emit noise.
Closes https://github.com/MusicPlayerDaemon/MPD/issues/771
2020-07-02 15:20:43 +02:00
Max Kellermann
fe5b81e180
output/osx: check started
in Close() and Cancel()
2020-07-02 15:19:40 +02:00
Max Kellermann
f032925c2d
output/osx: add started
flag
...
This will keep track of AudioOutputUnitStart() and
AudioOutputUnitStop(). This will provide some separation between "not
(yet) (re)started" and "paused".
2020-07-02 15:18:37 +02:00
Max Kellermann
8125a5dddb
output/osx: don't uninitialize AudioUnit if restart fails
...
This shall be done by Close(), which will be called automatically
after an error.
2020-07-02 15:10:03 +02:00
Max Kellermann
154170e475
output/osx: clear pause
flag only after successful AudioOutputUnitStart()
2020-07-02 15:08:59 +02:00
Max Kellermann
fb83936feb
apple/AudioUnit: add AudioUnitSetPropertyT()
2020-07-02 14:59:40 +02:00
Max Kellermann
db8bf52f7d
apple/AudioObject: add AudioObjectGetStringProperty()
2020-07-02 13:50:05 +02:00
Max Kellermann
756f0b8027
apple: build static library
...
Move build rules from src/output/plugins/meson.build
2020-07-02 13:49:54 +02:00
Max Kellermann
b1fba8d3d7
apple/AudioObject: add missing inline
2020-07-02 13:49:52 +02:00
Max Kellermann
4d88bddfe2
Merge branch 'v0.21.x'
2020-07-01 23:07:57 +02:00
Max Kellermann
e606044271
apple/AudioUnit: library wrapping AudioUnit*() functions
2020-07-01 23:02:22 +02:00
Max Kellermann
bcbb3371ff
apple/AudioUnit: rename to AudioObject.hxx
2020-07-01 22:49:03 +02:00
Max Kellermann
de632882d1
output/osx: move code to FindAudioDeviceByName()
2020-07-01 22:48:12 +02:00
Max Kellermann
745e492d15
output/osx: use [[maybe_unused]]
2020-07-01 22:41:00 +02:00
Max Kellermann
c5dc615efe
output/osx: use IsDigitASCII()
2020-07-01 22:39:54 +02:00
Max Kellermann
a08d4b3d66
Merge branch 'v0.21.x'
2020-07-01 22:09:33 +02:00
Max Kellermann
beeb02025e
output/osx: use range-based for
2020-07-01 22:06:36 +02:00
Max Kellermann
cdf7062597
apple/AudioUnit: wrapper functions for AudioObject properties
2020-07-01 22:05:11 +02:00
Max Kellermann
346084da1e
apple/Throw: new helper library replacing osx_os_status_to_cstring()
2020-07-01 22:05:11 +02:00
Max Kellermann
bbceb5eb91
output/osx: silently ignore some errors in osx_output_set_device()
2020-07-01 22:05:11 +02:00
Max Kellermann
90d85319c2
apple/ErrorRef: new library wrapping CFErrorRef
2020-07-01 22:05:10 +02:00
Max Kellermann
3d03683e7d
output: use StringIsEqual()
2020-07-01 22:04:26 +02:00
Max Kellermann
d8a74802d1
apple/StringRef: new library wrapping CFStringRef
2020-07-01 22:01:53 +02:00
Max Kellermann
191919d1b1
output/osx: remove trailing newline from exception messages
2020-07-01 22:01:51 +02:00
Max Kellermann
df38e7565b
util/HugeAllocator: import std::swap()
2020-07-01 21:56:58 +02:00
Max Kellermann
cb49a03fd7
util/HugeAllocator: add noexcept
2020-07-01 21:56:54 +02:00
Max Kellermann
faee5bbb78
decoder/opus: implement End Trimming (RFC7845 4.4)
...
Closes https://github.com/MusicPlayerDaemon/MPD/issues/867
2020-07-01 21:26:34 +02:00
Max Kellermann
7befab7e83
decoder/opus: keep track of the granulepos
...
Will be needed for End Trimming (RFC7845 4.4,
https://github.com/MusicPlayerDaemon/MPD/issues/867 ).
2020-07-01 21:21:06 +02:00
Max Kellermann
4244e61214
decoder/opus: simplify indentation in HandleAudio()
2020-07-01 21:19:52 +02:00
Max Kellermann
46eab05045
decoder/opus: allocate buffer only in the first chained song
...
Fixes memory leak. That's what we get for
2020-07-01 21:07:49 +02:00
Max Kellermann
5ca137c73c
decoder/opus: add API docs
2020-07-01 20:55:18 +02:00
Max Kellermann
760238fe16
decoder/opus: apply pre-skip (RFC7845 4.2)
...
Fixes the first part of
https://github.com/MusicPlayerDaemon/MPD/issues/867
2020-07-01 20:44:53 +02:00
Max Kellermann
a99b4abae8
decoder/OpusHead: return pre-skip
2020-07-01 17:51:07 +02:00
Max Kellermann
472881cb95
util/ByteOrder: remove redundant inline
keywords from constexpr
functions
2020-07-01 17:50:34 +02:00
Max Kellermann
c4efc37ad8
system/ByteOrder: move to util/
2020-07-01 17:49:57 +02:00
Max Kellermann
691b6a236e
output/osx: improve sample rate selection
...
The formula in osx_output_score_sample_rate() to detect multiples of
the source sample rate was broken: when given a 44.1 kHz input file,
it preferred 16 kHz over 48 kHz, because its `frac_portion(16)=0.75`
is smaller than `frac_portion(48)=0.91`.
That formula, introduced by commit 40a1ebee29
, looks completely
wrong. It doesn't do what the code comment pretends it does.
Instead of using that `frac_portion` to calculate a score, this patch
adds to the score only if `frac_portion` is nearly `0` or `1`. This
means that the factor is nearly integer.
Closes https://github.com/MusicPlayerDaemon/MPD/issues/904
2020-07-01 17:38:08 +02:00
Max Kellermann
5c7243d3ad
output/osx: make several fields const
2020-07-01 17:35:39 +02:00
Max Kellermann
44cfdff39a
output/osx: make variables more local
2020-07-01 17:35:33 +02:00
Max Kellermann
5eedda691a
output/osx: make more AudioObjectPropertyAddress instances static constexpr
2020-07-01 17:35:19 +02:00
Max Kellermann
a30d5e1b6a
output/osx: make AudioObjectPropertyAddress variables static constexpr
2020-07-01 17:34:12 +02:00
Max Kellermann
8ef09a0a71
output/osx: don't use C99 designated initializers
...
Fixes `-Wpedantic`.
2020-07-01 17:34:06 +02:00
Max Kellermann
e8044663b3
output/{alsa,osx}: use ConstBuffer::empty()
2020-07-01 17:32:37 +02:00
Max Kellermann
8444c33514
output/osx: don't use variable-length arrays
2020-07-01 17:31:46 +02:00
Max Kellermann
2b7328b434
output/osx: fix coding style
2020-07-01 17:11:02 +02:00
Max Kellermann
3d7147390f
Merge branch 'v0.21.x'
2020-07-01 16:56:17 +02:00
Max Kellermann
25b5ca6435
output/plugins/meson.build: add dependency on libevent.a for ALSA
2020-07-01 15:24:52 +02:00
Max Kellermann
fd217daad4
meson.build: always write encoder/Features.h
...
Fixes a build failure in `CommandLine.cxx`.
Closes https://github.com/MusicPlayerDaemon/MPD/issues/905
2020-07-01 15:16:14 +02:00
Max Kellermann
d9f9b3df10
input/file: detect premature end of file
...
A bug report (https://github.com/MusicPlayerDaemon/MPD/issues/912 )
suggests that on Linux, reading on `cifs` files may rarely return 0 (=
end of file) before the end of the file has really been reached. But
that's just a theory which I need to validate, so this runtime check
shall catch this condition before the assertion in
DecoderBridge::Read() crashes MPD. Let's see.
Closes https://github.com/MusicPlayerDaemon/MPD/issues/912
2020-07-01 15:14:27 +02:00
Max Kellermann
a43ee97746
util/UriUtil: strip credentials from smb:// URIs
...
Closes https://github.com/MusicPlayerDaemon/MPD/issues/910
2020-06-22 22:48:56 +02:00
Max Kellermann
43c32372e7
util/UriUtil: make schemes
array static
2020-06-22 22:48:07 +02:00
Max Kellermann
5716cde1fb
queue/PlaylistEdit: fix crash in SetSongIdRange() while playing
...
An assertion failure in UpdateQueuedSong() could trigger because the
`prev` parameter is always `nullptr`, but `queued` may be set. And in
fact, calling UpdateQueuedSong() is only necessary when the queued
song was edited, to re-queue it with the new range.
Closes https://github.com/MusicPlayerDaemon/MPD/issues/901
2020-06-11 07:07:02 +02:00
Max Kellermann
c6a7f6dabc
release v0.21.24
...
-----BEGIN PGP SIGNATURE-----
iQJEBAABCgAuFiEEA5IzWngIOJSkMBxDI26KWMbbRRIFAl7hRzQQHG1heEBtdXNp
Y3BkLm9yZwAKCRAjbopYxttFEp7dD/483fkBEyipufQyQT9nntP8R/vqKlUT+M9V
8LyoJBtNtbNkO4bdrgAQCzElYzkDnd8VR++ZDEcqSEF49y5wafsiuufJNW2/s02Y
ygAqgTCpcuS58F7aK92CW99bhZcKC6zoQovkenSMaZ39gorE1ZuO1JyrFR1LWOat
ELekougQe0JbX2YX0YOH0Qags5fv9joxYJYsx8ZC60sCRNc+h8CBQjpyhZqzk7wC
EPviLeMDw5lXkoSI3C045QmwJRFG8GMEyZ/4E/mnibxoTXBJmsm4ArKrfJznrUUs
r8Mkf4G7sVqbsRMyMFBpzw+lsRDpVWI26mhdah9Y1zuUYPaEMe7OVKuEsASJQ/oK
33wRSBVZc7EPhV3m8f7U8NAJI0/XaaPKGgP2OrtnOfxD+OyAze4vNLZ/GJCYSsh+
wN1grmJw1mTP52xBicN2AITqXSVVpuvznn+p0g9MBB9Nw8/vbeWaqGPQhMHGHW6a
JIL9yUTWwhkvkhav1bT7zKaeZv3qfgO7fjkgJqQFYt/q4FZwPFHJme55mVGq9d1y
FNR8BMh+0A8hRhhQVwVycLxr4+NJja3vaqx+uVG2kov1g3eQBSgnEYCiEV7uls4V
Pr4sIEeU/QQ+0jsMoJCaW65bNm4tOGKibpjSHrwJ+gxwKn3N7sJaAOo7PgGsUZyS
30cBC5zkjw==
=XHev
-----END PGP SIGNATURE-----
Merge tag 'v0.21.24'
release v0.21.24
2020-06-10 22:58:41 +02:00
Max Kellermann
6b3a282db4
lib/curl/Request: don't enable CURLOPT_NETRC on Windows
...
Our Windows build is built with `--disable-netrc`, and that makes
CURLOPT_NETRC fail, causing failures with all streams. D'oh!
Closes https://github.com/MusicPlayerDaemon/MPD/issues/886
2020-06-10 22:46:42 +02:00
Max Kellermann
aafc9ce75b
decoder/gme: use class NarrowPath() for Windows compatibility
2020-06-10 21:22:00 +02:00
Max Kellermann
fea326530b
decoder/gme: simplify LoadGmeAndM3u() by moving code to ReplaceSuffix()
2020-06-10 21:20:49 +02:00
Max Kellermann
8925cc17d8
decoder/gme: use StringAfterPrefix()
2020-06-10 21:11:08 +02:00
Max Kellermann
14412c867f
add a few IWYU pragmas
2020-06-10 21:10:33 +02:00
Max Kellermann
c5cc256bf2
decoder/gme: use Path::GetSuffix()
2020-06-10 21:02:07 +02:00
Max Kellermann
563c7318f9
fs/AllocatedPath: add method GetSuffix()
2020-06-10 21:00:41 +02:00
Max Kellermann
374cc51f77
decoder/Bridge: add flag to make initial seek errors fatal
...
When the client wants to seek, but the decoder has already finished
decoding the current song, the player restarts the decoder with an
initial seek at the new position. When this initial seek fails, MPD
pretends nothing has happened and plays this song from the start.
With this new flag, a restarted decoder marks the initial seek as
"essential" and fails the decoder if that seek fails.
Closes https://github.com/MusicPlayerDaemon/MPD/issues/895
2020-06-10 17:49:10 +02:00
Max Kellermann
068006ebd7
decoder/Bridge: install an InputStreamHandler on local files
...
Before the advent of io_uring (commit dae8da7066
), this didn't
matter, because the `FileInputStream` never called this. But
`UringInputStream` is derived from `AsyncInputStream`, and needs the
handler to signal completion.
Closes https://github.com/MusicPlayerDaemon/MPD/issues/898
2020-06-09 21:07:38 +02:00
Shen-Ta Hsieh
93d87854e9
src/output: add wasapi output and mixer plugin
2020-05-30 22:21:03 +08:00
Shen-Ta Hsieh
e5eac71d72
win32: add COM helper classes
2020-05-30 22:21:03 +08:00
Max Kellermann
f20b927858
Merge branch 'v0.21.x'
2020-05-30 14:05:18 +02:00
Rosen Penev
e4dad42ca1
use std chr functions
...
The ones in std have overloads for const char/char.
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-05-30 13:36:53 +02:00
Max Kellermann
99afe8e6d1
lib/icu/Win32: paranoid-ify the buffer length checks
...
Passing `length+1` to `MultiByteToWideChar()` means the function may
fill the whole buffer with output data, and could theoretically
overwrite the null terminator. In practice, this will never happen,
but this way, it's slightly more correct.
Also, null-terminate after `MultiByteToWideChar()`, after we got the
real output length. Again, this would never have been a problem, but
who knows...
2020-05-30 13:29:09 +02:00
Rosen Penev
1008d5f67c
use cwchar include
...
Needed for std::wmemchr under libcxx
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-05-30 13:22:04 +02:00
Shen-Ta Hsieh
169810e8f4
lib/icu: add null terminate in win32 string and wstring
2020-05-30 04:04:34 +08:00
Shen-Ta Hsieh
8e07ea7ad8
src/db: fitting libmpdclient interface
2020-05-29 19:00:16 +02:00
Max Kellermann
9f5c6d29b2
output/osx: use range-based for
2020-05-28 15:59:52 +02:00
Max Kellermann
f6823cc679
output/osx: move code to FindAudioDeviceByName()
2020-05-28 15:54:57 +02:00
Max Kellermann
69c0f0fe99
apple/AudioUnit: wrapper functions for AudioObject properties
2020-05-28 15:54:57 +02:00
Max Kellermann
28a00472ff
apple/Throw: new helper library replacing osx_os_status_to_cstring()
2020-05-28 15:06:53 +02:00
Max Kellermann
8d540737b9
output/osx: silently ignore some errors in osx_output_set_device()
2020-05-28 15:06:51 +02:00
Max Kellermann
1112d779be
apple/ErrorRef: new library wrapping CFErrorRef
2020-05-28 15:06:41 +02:00
Max Kellermann
ecced0ce13
apple/StringRef: new library wrapping CFStringRef
2020-05-28 15:06:38 +02:00
Max Kellermann
d751df0a73
storage/State: disable -Wcomma to work around Boost compiler warning
2020-05-28 14:00:31 +02:00
Max Kellermann
2c084781b0
output/openal: disable -Wdeprecated-declarations on Apple
2020-05-28 13:59:52 +02:00
Max Kellermann
6e1a21a42a
output/osx: make several fields const
2020-05-28 13:59:32 +02:00
Max Kellermann
80e8338014
output/osx: make variables more local
2020-05-28 13:44:28 +02:00
Max Kellermann
bfaa7afcb0
output/osx: make more AudioObjectPropertyAddress instances static constexpr
2020-05-28 13:39:46 +02:00
Max Kellermann
7fdbaa6156
output/osx: make AudioObjectPropertyAddress variables static constexpr
2020-05-27 19:50:44 +02:00
Max Kellermann
aa7dc62f72
output/osx: don't use C99 designated initializers
...
Fixes `-Wpedantic`.
2020-05-27 19:50:43 +02:00
Max Kellermann
6a4992118a
lib/ffmpeg/Time: redefine AV_TIME_BASE_Q with initializer list
...
libavutil's macro definition is a compound literal, which is illegal
in C++. Fixes yet another -Wpedantic warning.
2020-05-27 16:55:55 +02:00
Max Kellermann
f03cc1012d
lib/upnp/Compat: workaround for -Wkeyword-macro
2020-05-27 16:50:27 +02:00
Max Kellermann
736a696f98
lib/upnp: drop support for libupnp versions older than 1.8
2020-05-27 16:49:02 +02:00
Max Kellermann
caec384ed0
archive/ArchiveList, input/Registry: avoid zero-sized array
...
Some more `-Wpedantic` fixups.
2020-05-27 16:31:52 +02:00
Max Kellermann
5e93e882c9
Merge branch 'v0.21.x'
2020-05-27 16:16:30 +02:00
Max Kellermann
30d97fe8a0
meson.build: fix the WildMidi check when the feature is disabled
...
Fixes regression from commit 69f09648a4
2020-05-27 16:06:49 +02:00
Max Kellermann
8e4ca23727
lib/ffmpeg/Time: replace C99 compound literal with C++ initializer list
2020-05-27 15:54:34 +02:00
Max Kellermann
bdc861f058
util/TemplateString: remove extra semicolon
2020-05-27 15:46:55 +02:00
Rosen Penev
8925040262
remove some more extra semicolons
...
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-05-27 15:36:53 +02:00
Max Kellermann
4e5d6e560b
decoder/modplug: assume ModPlug is built as static library on Windows
2020-05-27 15:03:46 +02:00
Max Kellermann
d276d8eda2
decoder/wildmidi: assume WildMidi is built as static library on Windows
2020-05-27 15:03:35 +02:00
Max Kellermann
ebcb5e9368
decoder/wildmidi: use NarrowPath, fixing the Windows build
2020-05-27 15:03:33 +02:00
Max Kellermann
69f09648a4
meson.build: attempt to detect WildMidi using pkg-config
...
The WildMidi project added the pkg-config file in version 0.3.3, but
unfortunately, Debian still doesn't ship it 4 years later:
https://bugs.debian.org/916631
However, for cross-compiling, the pkg-config file is very helpful.
2020-05-27 15:03:16 +02:00
Max Kellermann
6cc58ccb9b
lib/icu/Converter: add missing <string_view> include
2020-05-26 17:48:01 +02:00
Max Kellermann
be94b4373a
util/OffsetPointer: add noexcept
2020-05-14 15:44:23 +02:00
Max Kellermann
eeec0ee804
dsd/Dsd2Pcm: convert struct GenerateCtableValue to lambda
...
Since we have dropped support for GCC 6 a while ago, we can use
constexpr lambdas now.
2020-05-07 15:04:51 +02:00
Max Kellermann
60f957ed64
util/MimeType: use string_view::substr()
...
Fixes regression from commit db93bb996c
because
ParseMimeTypeParameters() assumed the items were null-terminated, but
after that commit, they were not anymore.
2020-05-06 20:33:13 +02:00
Max Kellermann
864d26cd1b
Merge branch 'bind' of git://github.com/neheb/MPD
2020-05-06 06:14:55 +02:00
Max Kellermann
ba576ffa37
Merge branch 'v0.21.x'
2020-05-05 19:00:53 +02:00
Max Kellermann
209364adf2
db/simple: fix crash when mounting twice
...
The `db->close()` call was a `nullptr` dereference because the `db`
variable had already been moved.
Closes https://github.com/MusicPlayerDaemon/MPD/issues/839
2020-05-05 18:57:29 +02:00
Max Kellermann
dae8da7066
input/uring: new input plugin using io_uring
...
This is the final piece of the series to establish io_uring support on
Linux.
MPD doesn't need io_uring for its efficient bulk I/O support, but to
allow file I/O to be cancelled. This is a big problem on CIFS/NFS
mounts where processes sleep uninterruptable if the file server
disappears, deadlocking MPD.
With io_uring, a flaky NFS connection allows MPD to continue to work
(even though there are still deadlocks inside MPD which need to be
addressed).
This plugin does not yet use cancellable `open()` using
`IORING_OP_OPENAT`. This will be implemented later.
Lots of other optimization opportunities for io_uring are still
missing as well - for example the database update could benefit a lot,
but unfortunately, io_uring doesn't have `readdir()` support just yet.
2020-05-05 17:41:03 +02:00
Max Kellermann
cdf8ac001c
event/Loop: integrate io_uring support
2020-05-05 17:13:14 +02:00
Max Kellermann
62d0ceabcc
io/uring: basic Linux io_uring support
2020-05-05 17:10:17 +02:00
Max Kellermann
935e622915
event/Loop: allow calling AddFD()... before starting the EventThread
...
Relax the assertions. This is necessary if BlockingCall() is used
before the thread is started.
2020-05-05 17:10:17 +02:00
Max Kellermann
1efbbfcd6f
GitVersion: make GIT_VERSION const
2020-05-05 15:12:40 +02:00
Max Kellermann
e0edf0b206
meson.build: move VERSION and others to Version.h
2020-05-05 15:12:11 +02:00
Max Kellermann
8f178401e4
*/plugins/meson.build: define feature macros in Features.h
...
This makes ccache more efficient when recompiling with different
plugins.
2020-05-05 15:06:50 +02:00
Max Kellermann
8c1d78873d
system/KernelVersion: new library
2020-05-05 14:30:56 +02:00
Max Kellermann
9815d10137
system/FileDescriptor: move to io/
2020-05-05 14:27:03 +02:00
Max Kellermann
97f7270aa8
fs/FileSystem: remove unused function FOpen()
2020-05-05 14:19:29 +02:00
Max Kellermann
1787aa5e00
decoder/sidplay: drop support for libsidplayfp < 1.8
2020-05-05 13:53:10 +02:00
Rosen Penev
e6a77e1297
remove std::bind usage as much as possible
...
Reduces unstripped size. stripped size is the same.
Also took the time to remove using std::placeholders.
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-05-04 15:40:28 -07:00
Max Kellermann
24afdee35c
command/all: "tagtypes" requires no permissions
...
The command is used to configure the client's connection, and this
shouldn't require any permissions. The client should be able to do
that before sending a password.
2020-04-30 13:08:09 +02:00
Max Kellermann
7aea285361
Revert "Fix unsafe float comparison."
...
This reverts commit a5273d6992
. It was
wrong and broke the MixRamp unit test.
Closes https://github.com/MusicPlayerDaemon/MPD/issues/844
2020-04-30 06:57:36 +02:00
Rosen Penev
47a7707df1
Math.hxx: fix wrong macro name
...
_GLIBCXX_USE_C99_MATH_TR1 is the correct one.
_GLIBCXX_USE_C99_MATH is always defined.
2020-04-29 23:20:04 +02:00
skidoo23
a485c4856c
decoder/sidplay: support new song length format with libsidplayfp 2.0
2020-04-29 16:27:54 +02:00
Max Kellermann
bca9678683
tag/FixString: use IsNonPrintableASCII()
...
Fixes breakage of non-ASCII characters, regression from commit
cc72ceb368
Fixes https://github.com/MusicPlayerDaemon/MPD/issues/842
2020-04-27 14:01:54 +02:00
Max Kellermann
814b2a218d
util/CharUtil: add IsNonPrintableASCII()
...
Prepare to fix cc72ceb368
2020-04-27 14:01:54 +02:00
John Regan
6423670eae
gme: use song-reported fade-out time when available
2020-04-26 09:24:34 -04:00
John Regan
90a2109fd1
gme: add configurable fade-out time
...
Also include fade-out time in song length.
2020-04-26 09:21:57 -04:00
Max Kellermann
464b90210c
tag/GenParseName: include stdlib.h for EXIT_SUCCESS
...
Closes https://github.com/MusicPlayerDaemon/MPD/issues/838
2020-04-24 20:39:24 +02:00
Max Kellermann
fa45a8adfa
tag/ParseName: generate an optimized tag_name_parse() at build time
2020-04-24 16:28:29 +02:00
Max Kellermann
1532983fb5
tag/Pool: use strncmp() without strlen() to compare strings
2020-04-24 16:16:19 +02:00
Max Kellermann
ae5b2643da
tag/Builder: reserve room in std::vector in default constructor
...
This reduces resource waste for resizing the std::vector in most
cases.
2020-04-24 16:16:19 +02:00
Max Kellermann
02556ffce9
tag/Tag: use class DereferenceIterator
2020-04-24 16:02:36 +02:00
Max Kellermann
18ca734819
util/DereferenceIterator: new utility class
2020-04-24 16:02:31 +02:00
Max Kellermann
8a28f7b0a1
tag/FixString: add optimistic quick check
...
Optimizes a few nanoseconds from the common code path.
2020-04-24 15:57:40 +02:00
Max Kellermann
cc72ceb368
tag/FixString: use IsPrintableASCII()
2020-04-24 15:42:09 +02:00
Max Kellermann
0b3acc3eec
release v0.21.23
...
-----BEGIN PGP SIGNATURE-----
iQJEBAABCgAuFiEEA5IzWngIOJSkMBxDI26KWMbbRRIFAl6huEwQHG1heEBtdXNp
Y3BkLm9yZwAKCRAjbopYxttFEgcrD/9jLUkiszNc+QWbUGj+RiTaD6fMxA1M8itn
nB7MKI/g/3ggryWMWNhG51O+8wFNs/4PmJJPGxKoU6i6wmS3YFhTAcs0ryilDGAU
1FumnMg/2qIyi2E6K2BMbi0YwZiJhBPWwD4JSt1KGvwPes/qQPFgHAi7ZWhP3tar
fHmgmjwDZ/Kgpl5/Bn7nVNgVuzk/MpBOSwxX9tFtRxqE9wdpm9idve7SVDT7MTvk
vdONWbAe8jXl/A8JHWaUsws0l7fyK5ZKSOXvdeSbzd67I8Rz3aqJMqUh2k/rDuv/
GrDyeEtLV5cXZsL4B3/34kCTKac2ZJmRbSh+buKeDc1Gf0clWnvRMdsMbSoRBY4F
lTWJbjndfq2+iHHBRfaqRjombv52R11yLT+O0aMLEm6l7xPm/rHZXJIcYSmCafd7
FR1qMaVKP5s+M+MqGePxzCUJSWJ+1bjZwjLaHrYXYPUoXSg3mSaeDE5g7BjQhm1E
2Hcfui9lvqR55UNo0NvDBjRT5FBGBUdjF6DjYplUGApw7xFtdahXlEvG7yfyg3ae
pZ3FQ1MZ4dESAw7EhTEBwajsVRQ9DhGQenYTxxCnGVdCucZRPQ9Abhas0U4iFHUA
wGj7j4WKPi+OUSyiT0j4nGuwEVtCkBFv34DqPMLjx8jqtJ8YgCt4iJD4dFwhk1zz
uoQBhq27Gg==
=sR2r
-----END PGP SIGNATURE-----
Merge tag 'v0.21.23'
release v0.21.23
2020-04-23 18:01:23 +02:00
Max Kellermann
3040ddb5ec
lib/nfs/FileReader: use struct stat64
on Windows 32-bit
...
libnfs is compiled with `-D_FILE_OFFSET_BITS=64`, but Meson decides
not to enable this mode. We could force this mode, but then again,
these days, nobody should be using 32-bit Windows ... so this is a
kludge only for debugging with 32-bit WINE.
2020-04-23 17:32:34 +02:00
Max Kellermann
fdb28eb0c4
fs/NarrowPath: preserve nullptr in Path operator
...
Fixes Path::IsNull() checks on Windows.
2020-04-23 17:10:28 +02:00
Max Kellermann
7ded244a61
lib/nfs/Connection: pass POLLHUP and POLLERR to nfs_service()
2020-04-23 16:58:53 +02:00
Max Kellermann
8ed533acf3
event/SocketMonitor: handle epoll_ctl()=EBADF/ENOENT in Schedule()
...
This fixes a freeze bug in the NFS input/storage plugins: when libnfs
auto-reconnets after a failure, it installs the new socket on the same
file descriptor number. MPD's attempt to unregister the old socket by
calling SocketMonitor::Steal() from NfsConnection::ScheduleSocket()
fails because the new/old socket number is not registered in epoll, so
epoll_ctl() returns ENOENT. The problem is that it left
`scheduled_flags`, and so subsequent Schedule() calls will use
`EPOLL_CTL_MOD`, which will fail again and again. Instead, we need to
use `EPOLL_CTL_ADD` to register the new socket.
Closes https://github.com/MusicPlayerDaemon/MPD/issues/806
Closes https://github.com/MusicPlayerDaemon/MPD/issues/756
2020-04-23 16:58:26 +02:00
Max Kellermann
a27580d0cc
lib/nfs/Connection: don't pass HANGUP to Schedule()
...
This flag is output-only.
2020-04-23 15:21:04 +02:00
Max Kellermann
905db05cf9
zeroconf/AvahiPoll: don't pass ERROR|HANGUP to Schedule()
...
These flags are output-only.
2020-04-23 15:19:24 +02:00
Max Kellermann
4242aee21e
event/SocketMonitor: remove HANGUP|ERROR from ScheduleRead()
...
These flags are output-only. Using them here is misleading.
2020-04-23 15:18:18 +02:00
Max Kellermann
e71bd2a08b
event/PollGroupWinSelect: make EVENT_{READ,WRITE} static
2020-04-23 15:10:57 +02:00
Max Kellermann
e53a4d0a9e
lib/nfs/FileReader: reset state
in OnNfsCallback()
...
The object's state is `IDLE` when OnNfsCallback() gets invoked, so
let's use the start of the method to reset the `state` field.
2020-04-23 14:54:52 +02:00
Max Kellermann
159389164a
lib/nfs/FileReader: set state=IDLE
before invoking callback
...
Fixes assertion failure if the callback fails.
2020-04-23 14:51:43 +02:00
geneticdrift
0a92fbc18e
tag/Fallback: add tag fallback for AlbumSort
...
Closes https://github.com/MusicPlayerDaemon/MPD/issues/832
2020-04-22 22:00:38 +02:00
Max Kellermann
138c29320b
gme: adapt to API change in the upcoming version 0.7.0
...
Closes https://github.com/MusicPlayerDaemon/MPD/issues/833
2020-04-22 21:53:00 +02:00
Max Kellermann
8f00dbea45
lib/icu/Compare: add Windows implementation
...
Using CompareStringEx() and FindNLSStringEx().
Implements a missing piece for
https://github.com/MusicPlayerDaemon/MPD/issues/820
2020-04-22 21:42:12 +02:00
Max Kellermann
f3fd2eb618
lib/icu/Compare: use AllocatedString::Clone()
2020-04-22 21:39:13 +02:00
Max Kellermann
fc92db83cf
lib/icu/Collate: use NORM_IGNORECASE instead of LINGUISTIC_IGNORECASE
...
LINGUISTIC_IGNORECASE is unimplemented on Wine, but since we don't
have any locale support (yet), and we're using LOCALE_NAME_INVARIANT,
NORM_IGNORECASE should essentially be the same, so why bother.
2020-04-22 21:39:13 +02:00
Max Kellermann
3b0f8d5516
lib/icu/CaseFold: remove Windows implementation
...
Reverts commit fb3564fbe7
LCMapStringEx() doesn't do what I imagined it would do 5 years ago.
D'oh!
Closes https://github.com/MusicPlayerDaemon/MPD/issues/820
2020-04-22 19:32:36 +02:00
Rosen Penev
a5273d6992
Fix unsafe float comparison.
...
Switching == to >= should be safe here since the next if is the opposite.
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-04-22 18:21:40 +02:00
Rosen Penev
6979be008c
[clang-tidy] use auto
...
Found with modernize-use-auto.
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-04-22 18:21:07 +02:00
Rosen Penev
71792ffd43
[clang-tidy] use raw string
...
Found with modernize-raw-string-literal
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-04-22 18:21:00 +02:00
Rosen Penev
3c145c0f49
[clang-tidy] add nodiscard
...
Found with modernize-use-nodiscard
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-04-22 18:20:51 +02:00
Thomas Guillem
b18074f899
storage/curl: fix path comparison when the server escapes differently
...
Unescape the base path and the path coming from the server (href) to fix the
comparison when the server uses different escaped characters.
The outputted name need to be unescaped. Doing that before or after the
HrefToEscapedName() call should not change the current behavior.
2020-04-15 13:50:12 +02:00
Thomas Guillem
3d8067a041
storage/curl: fix href when file has a '&' char
...
If the file name is "Hello & bye", 3 CharacterData events will be sent with the
State::HREF state:
- "Hello%20"
- "&"
- "%20bye"
Reproduced with files hosted on an apache2 DAV server: 2.4.38-3+deb10u3.
2020-04-15 13:18:16 +02:00
Florian Heese
f6fe001fa9
Added missing channel order setups for ALSA
2020-04-15 13:13:09 +02:00
Max Kellermann
32a5bf043b
player/Thread: drain outputs at end of song in "single" mode
...
Without this, the Pause() call would drop the ring buffers and would
skip a considerable portion of the end of the song.
Closes https://github.com/MusicPlayerDaemon/MPD/issues/824
2020-04-14 16:07:03 +02:00
nia
8437b141a4
SolarisOutputPlugin: Support S8 and S32 encodings.
2020-04-14 14:38:30 +01:00
nia
1f0881eec0
SolarisOutputPlugin: Use AUDIO_INITINFO for initialization
...
This is recommended by Solaris and NetBSD documentation.
2020-04-14 14:20:24 +01:00
Rosen Penev
6080c3b4ba
Math.hxx: move cmath include out of define
...
The _GLIBCXX_USE_C99_MATH macro is defined in glibcxx by c++config.h, which
gets included by every header. Which means a header needs to be present.
(cherry picked from commit 79e9aff338
)
2020-04-09 14:24:06 -07:00
Max Kellermann
3c240e2119
db/simple/DirectorySave: pass std::string_view to _load_subdir()
...
Eliminates one strlen() call.
2020-04-08 23:54:58 +02:00
Max Kellermann
57fb153c5d
db/Interface: pass std::string_view to GetSong()
2020-04-08 23:43:59 +02:00
Max Kellermann
212401d687
db/update/Service: pass std::string_view to Enqueue()
2020-04-08 23:38:28 +02:00
Max Kellermann
dd831d3922
db/simple: pass std::string_view to Directory::LookupDirectory()
2020-04-08 23:38:24 +02:00
Max Kellermann
9f8dc31b50
input/Plugin: copy protocols() to stack before using it
...
Fixes regression by commit 015cbff93d
causing a crash bug because the
iterators of two different temporaries were used.
2020-04-08 23:37:32 +02:00
Max Kellermann
db93bb996c
util/SplitString: convert return value to std::string_view
...
Eliminates lots of overhead.
2020-04-08 23:14:25 +02:00
Max Kellermann
2c02a04566
db/update/Walk: pass std::string_view to DirectoryMakeUriParentChecked()
...
Split the string into path segments with StringView::Split(). This
prepares to eliminate all allocations from the method.
2020-04-08 23:09:37 +02:00
Max Kellermann
f13f66487a
fs/Charset: pass std::string_view to PathToUTF8()
2020-04-08 23:04:37 +02:00
Max Kellermann
0a4c5edc3b
Merge branch 'stl' of git://github.com/neheb/MPD
2020-04-08 23:03:44 +02:00
Rosen Penev
015cbff93d
[cppcheck] convert several functions to use std::all_of
...
std::all_of becomes constexpr in C++20. I'm not sure it results in better
performance.
Found with useStlAlgorithm
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-04-08 14:01:12 -07:00
Rosen Penev
79e9aff338
Math.hxx: move cmath include out of define
...
The _GLIBCXX_USE_C99_MATH macro is defined in glibcxx by c++config.h, which
gets included by every header. Which means a header needs to be present.
2020-04-07 20:14:00 -07:00
Max Kellermann
3a51fe31df
util/ConstBuffer, ...: use using
instead of typedef
2020-04-06 15:19:12 +02:00
Max Kellermann
cc3e71d8c7
util/CharUtil: add IsHexDigit()
2020-04-06 15:07:08 +02:00
Max Kellermann
dd37b4656e
storage/{composite,local}: fix -Wnonnull warnings
2020-04-06 15:06:52 +02:00
Max Kellermann
e2d2bb8755
storage/Composite: use IterableSplitString()
2020-04-03 19:51:14 +02:00
Max Kellermann
a98d627c0b
storage/Interface: convert URI parameters to std::string_view
2020-04-03 19:45:10 +02:00
Max Kellermann
0080eee857
fs/Traits: add Relative() overload with std::string_view
2020-04-03 19:45:01 +02:00
Max Kellermann
2429cc8778
fs/Traits: convert first Relative() parameter to std::string_view
2020-04-03 19:29:29 +02:00
Max Kellermann
3a83a6b527
storage/Composite: NextSegment() returns std::string_view
2020-04-03 19:29:01 +02:00
Max Kellermann
bcf4645263
db/simple/Directory: add LookupResult::uri
2020-04-03 17:18:00 +02:00
Max Kellermann
6c8eb3c7ed
db/simple/Directory: rename LookupResult::uri to "rest"
2020-04-03 17:07:15 +02:00
Max Kellermann
870151214d
util/SplitString: convert parameter to std::string_view
2020-04-03 16:47:45 +02:00
Max Kellermann
ae4fd576bf
output/ao: use IterableSplitString() instead of SplitString()
2020-04-03 16:47:25 +02:00
Max Kellermann
747436b17e
db,storage: pass std::string_view to PathTraits::Build()
2020-04-03 16:25:09 +02:00
Max Kellermann
7a58b8c3e8
fs/AllocatedPath: pass std::string_view to FromUTF8()
2020-04-03 16:21:41 +02:00
Max Kellermann
56b4b010d6
fs/FileSystem, ...: use AllocatedPath::FromFS(string_view)
2020-04-03 16:13:15 +02:00
Max Kellermann
91c75a133f
lib/icu/Collate: pass std::string_view
2020-04-03 16:13:15 +02:00
Max Kellermann
e620677d7c
lib/icu/CaseFold: pass std::string_view
2020-04-03 16:13:14 +02:00
Max Kellermann
09d8e44d56
lib/icu/Converter: pass std::string_view
2020-04-03 16:13:14 +02:00
Max Kellermann
9dc530ab51
lib/icu/Util: pass std::string_view
2020-04-03 16:13:14 +02:00
Max Kellermann
2d0798cd4d
lib/icu/Win32: pass std::string_view
2020-04-03 16:13:14 +02:00
Max Kellermann
a269fc988b
fs/Charset: enable RVO in FixSeparators()
2020-04-03 16:12:51 +02:00
Max Kellermann
915c48f748
util/AllocatedString: std::string_view support
2020-04-03 16:08:55 +02:00
Max Kellermann
f04a245769
util/AllocatedString: add noexcept
2020-04-03 15:26:47 +02:00
Max Kellermann
a8687fb7df
util/AllocatedString: use using
instead of typedef
2020-04-03 15:25:37 +02:00
Max Kellermann
3b88bac07c
util/StringPointer: add noexcept
2020-04-03 15:25:33 +02:00
Max Kellermann
358f231391
util/StringPointer: use using
instead of typedef
2020-04-03 15:25:16 +02:00
Max Kellermann
f0923231d0
storage/Interface: pass std::string_view to MapChildFS()
2020-04-02 20:14:00 +02:00
Max Kellermann
dadf054fbb
db/simple/Directory: reimplement LookupDirectory() without allocations
...
Use std::string_view to avoid modifying the string for the temporary
null terminators.
2020-04-02 20:08:00 +02:00
Max Kellermann
6593b5998a
db/simple/Directory: pass std::string_view to several methods
2020-04-02 19:58:24 +02:00
Max Kellermann
386235e2d2
db/simple/Mount: pass std::string_view to WalkMount()
2020-04-02 19:52:03 +02:00
Max Kellermann
ddfd92e547
db/simple/PrefixedLightSong: templatize the constructor
2020-04-02 19:51:41 +02:00
Max Kellermann
d5fd309484
db/update/IO: pass std::string_view to directory_child_is_regular()
2020-04-02 19:50:16 +02:00
Max Kellermann
6197b29aa0
db/PlaylistInfo: pass std::string_view to CompareName
2020-04-02 19:49:39 +02:00
Max Kellermann
02294a8236
song/Filter: pass std::string_view to WithoutBasePrefix()
2020-04-02 19:49:24 +02:00
Max Kellermann
66bcf04cbd
db/update/Queue: pass std::string_view to Push()
2020-04-02 19:49:16 +02:00
Max Kellermann
12b97bbe38
release v0.21.22
...
-----BEGIN PGP SIGNATURE-----
iQJEBAABCgAuFiEEA5IzWngIOJSkMBxDI26KWMbbRRIFAl6GCWgQHG1heEBtdXNp
Y3BkLm9yZwAKCRAjbopYxttFEvkQD/9qg6cnCgCKSOmTjteJu1ayeXBMDiL3cCCg
AwarHQoxsB0102NpV+MLka+4HIwHn+WNL55TzYgfbSh0nfmnki2fZ0YpsZoQR79w
MP11iMPnFH1oKqj58minBkFNmAis2aLYHJGKaQNUh7wcf0WhbVTqtWBUrKb07RQ0
Zj5lXtg65O/+yaCVdQGS6fMk2t7CqBM+S3RmbXCib/JRMC6aozoC7nWPvj8b2R8d
PgxwKMRzyslyFoxDQZrusDjJ1piyigzUMMr32yzYDED4Xr8jsEELaJfULbr6qWT2
ZNYF91e+D5V7riASAtlFTaVMaISx4QbHjKWR5Xcx0q/SJPAXTxF8RrAqGvqpWYmc
kqmC8iNxQsW5o3sNhI9qg6sOkq2dIu43VasRCvuo19GABR36wwTK5ORoazIi8fbU
/Ki/oZHtZczHRop9Cd6698Qr9jyTPdIs55FbgejzrVADvAmslqtcA6XxCBuG1nSF
Qo48dp9Px7J74qNNuDt5/xLnQGJKaW60/BXrMK9G9QG4x9r4zuCayDO6Qc7FMWWR
DG7k9nYoXJU5YG7xp9Rk+Yj3Ade8kqhTnKfqw0f2JfkLt0ChPG+rZcxICWSdzZm0
AfHxuEQlwKaaFHFEsZhVehlsXkeU9OVywo+QDzmY2uqQ2ddlBZ47Qm2MWgTsv8i/
euVsrzLtag==
=EedX
-----END PGP SIGNATURE-----
Merge tag 'v0.21.22'
release v0.21.22
2020-04-02 18:02:10 +02:00
Max Kellermann
afe2aaa5f6
fs/io/GzipOutputStream: increase buffer size to 16 kB
...
Reduce I/O overhead.
2020-04-02 17:17:58 +02:00
Max Kellermann
9b11caa0e6
fs/io/BufferedReader: larger default buffer (4 kB -> 16 kB)
...
Reduce I/O overhead.
2020-04-02 17:17:27 +02:00
Max Kellermann
e94c436264
src/event/meson.build: depend in libnet.a
...
The event library uses various libnet.a classes,
e.g. SocketDescriptor.
2020-04-02 17:16:05 +02:00
Max Kellermann
4d453a8313
fs/NarrowPath: add class FromNarrowPath
...
Move code from ParseCommandLine().
2020-04-02 17:15:34 +02:00
Max Kellermann
61d7b436a2
fs/NarrowPath: un-inline Windows constructor
2020-04-02 16:27:44 +02:00
Max Kellermann
cdddaf21b0
db/simple/Directory: optimize GetName() using the parent's path
...
This method gets called a lot during MPD startup, via FindChild() and
directory_load_subdir(), so this is worth optimizing at the expense of
code readability.
This speeds up MPD startup by 10%.
2020-04-02 16:12:08 +02:00
Max Kellermann
b267ba5f0a
tag/Pool: enlarge hash table
...
This consumes more memory (plus 48 kB on 32 bit systems), but reduces
the number of hash collisions, speeding up MPD startup with large
databases.
2020-04-02 15:45:35 +02:00
Max Kellermann
8270043053
Revert "decoder/ffmpeg: copy the AVPacket in ffmpeg_send_packet()"
...
This reverts commit eb192137d6
.
This is no longer necessary because we require FFmpeg 3.1 or newer
since MPD 0.21.2.
This fixes a deprecation warning because the implicit AVPacket copy
constructor copies the deprecated attribute `convergence_duration`.
2020-04-01 17:30:28 +02:00
Max Kellermann
672bc3ab67
time/Convert: fix GetTimeZoneOffset() on Windows
...
Was using the wrong parameter.
2020-04-01 16:21:29 +02:00
Max Kellermann
7d7bd51bc0
util/AllocatedArray: use using
instead of typedef
2020-04-01 15:42:55 +02:00
Rosen Penev
71e551df42
replace locale.h with clocale
...
Switch to std:: functions. Changed the meson check. Works locally.
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-03-31 18:05:23 -07:00
Max Kellermann
9c3e1d450a
fs/io/GunzipReader: increase buffer size to 64 kB
...
Reduces I/O overhead while reading a compressed database file.
2020-03-31 15:07:39 +02:00
Rosen Penev
3540cf26b1
replace exit and _exit with std variants
...
_exit and std::_Exit are identical, expect the latter is standard C++.
Added several functions to the std namespace as a result of headers.
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-03-26 18:44:09 -07:00
Max Kellermann
e1c43ec65f
Merge branch 'ucl' of git://github.com/neheb/MPD into v0.21.x
2020-03-26 17:28:21 +01:00
Thomas Guillem
4dd10894ba
lib/curl/Request: fix Exception "error" on Android
...
Apparently, it's not possible to change CURLOPT_NETRC on Android.
2020-03-26 17:26:14 +01:00
Rosen Penev
608d7ec1e7
[clang-tidy] change integer prefixes to uppercase
...
Found with readability-uppercase-literal-suffix
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-03-26 17:25:20 +01:00
Max Kellermann
8474599ed6
lib/curl/Easy: add method Unpause()
2020-03-26 17:22:10 +01:00
Max Kellermann
ab39f64fc0
lib/curl/Easy: add setter functions
2020-03-26 17:21:30 +01:00
Max Kellermann
185fbca282
lib/curl/Global: make ReadInfo() private
2020-03-26 17:20:10 +01:00
Max Kellermann
6e3b2fd844
lib/curl/Global: remove redundant API docs
2020-03-26 17:20:06 +01:00
Max Kellermann
dab39dc778
lib/curl: fix coding style
2020-03-26 17:19:48 +01:00
Max Kellermann
8cd5e79fbd
event/*, ...: make GetEventLoop() const
2020-03-26 17:19:13 +01:00
Max Kellermann
1de3ac6c78
lib/curl/Init: add const
overloads
2020-03-26 17:18:27 +01:00
Max Kellermann
abe06a5fa6
lib/curl/Init: add noexcept
2020-03-26 17:18:23 +01:00
Rosen Penev
85c27840a3
treewide: use boost::lround when std::round is unavailable
...
This is the case with uClibc-ng currently.
Signed-off-by: Rosen Penev <rosenp@gmail.com>
(cherry picked from commit 769cd0ee9f0cf8ceb026aa751b5d4a390bb5dbdc)
(changed define to match master)
2020-03-25 18:54:15 -07:00
Thomas Guillem
81c16273c5
output/sles: use the AndroidMixerPlugin
2020-03-25 20:08:53 +01:00
Thomas Guillem
801ae86b5d
mixer: add AndroidMixerPlugin
2020-03-25 20:07:26 +01:00
Thomas Guillem
5619fd0bba
android: Context: add GetAudioManager
2020-03-25 20:07:25 +01:00
Thomas Guillem
200258c7c3
android: add AudioManager
2020-03-25 20:07:24 +01:00
Max Kellermann
5418bb49fb
android/Context: add noexcept
2020-03-25 20:07:18 +01:00
Max Kellermann
3449c14ff5
java/Object: rename class Object to GlobalObject
2020-03-25 20:07:15 +01:00
Rosen Penev
cfa4524cb3
util/Math: change define
...
This has nothing to do with uClibc. It has everything to do with gcc's
libstdc++.
C99 math can be compile time disabled for it. Check for that and use boost
lround when std is not available.
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-03-25 19:27:45 +01:00
Rosen Penev
4fd0c84f46
replace lrint with lround
...
lrint is a configurable version of lround that behaves either as round,
floor, ceil, or trunc based on setting the proper FE_ macro using
fset/getround. Given that it's not set at all and that it defaults to
round behavior, simply replace with round.
Also removed the util/Math defines.
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-03-25 19:27:44 +01:00
Rosen Penev
e41a52d909
change abs() to std::abs()
...
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-03-25 19:27:42 +01:00
Rosen Penev
01e00632cc
[cppcheck] fix format string
...
Found with invalidPrintfArgType_sint
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-03-25 19:27:40 +01:00
Rosen Penev
9bad5ee3c5
remove boost pow stuff for uClibc-ng
...
It's available there.
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-03-24 17:21:21 -07:00
Rosen Penev
e87454ae88
MpcdecDecoderPlugin: use std variant of pow
...
It's available with uClibc-ng. It also offers overloads.
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-03-24 17:16:51 -07:00
Rosen Penev
f319f88df4
[cppcheck] use const for several variables
...
Found with constVariable
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-03-23 21:03:22 -07:00
Max Kellermann
637840264a
util/WStringCompare: reorder functions to relocate API docs
2020-03-22 19:20:29 +01:00
Max Kellermann
3888bafc1f
util/StringCompare: add API documentation
2020-03-22 19:15:55 +01:00