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
Max Kellermann
adad4c7298
util/StringCompare: add missing include
2020-03-22 19:12:02 +01:00
Max Kellermann
d54acbcffd
Merge branch 'sles-assert-fix' of git://github.com/tguillem/MPD-1
2020-03-22 10:51:28 +01:00
kowalcj0
36a89e8fe7
Support RSS feeds with application/xml MIME-type
2020-03-22 10:49:38 +01:00
Thomas Guillem
86613af37e
output/sles: fix invalid assert
...
Regression from 973c87b351
2020-03-21 22:34:04 +01:00
Rosen Penev
ba3ff10ccd
remove false ifdef
...
The entire section falls under the else path of #ifdef _WIN32. Checking
for it makes no sense. Probably some refactoring mistake.
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-03-20 17:56:33 -07:00
Max Kellermann
1ec283d213
util/Exception: include cleanup
2020-03-19 20:13:04 +01:00
Max Kellermann
2261bcb5d3
android/Environment: remove another extra semicolon
2020-03-19 20:13:04 +01:00
Max Kellermann
0e17629445
android/Environment: remove extra semicolon
2020-03-19 15:27:43 +01:00
Max Kellermann
0da6344726
release v0.21.21
...
-----BEGIN PGP SIGNATURE-----
iQJEBAABCgAuFiEEA5IzWngIOJSkMBxDI26KWMbbRRIFAl5zgCQQHG1heEBtdXNp
Y3BkLm9yZwAKCRAjbopYxttFEnkCD/0RNcohFb2svCDYXuAz3BN5hBxUvepMJJId
aNaT+jz8FpWTpIi4TaHqF4iODyDXR9YkVBv2aPqEjJad0tVEHHijyHkA25jd8moz
lR46RRK4CEkBTTlmui9FmajelqoidMxRMQLR8HRTKCQPPZcgXhNOhdciJg1EovMT
maZD81UyuZXPAq+v3IMJHy+H/LUA5yFcsjIdyJs7EEFZXHb9LUVRW/ZxUwFzl1Os
TAiLQ0Ix4ebsy1MmE4n7f9T6dAuPO/+GkHXMKn6ruvAYUKPeKcjjdm5QW+Gyt9X1
IArx0oaEqxPY5r7YruyGoPMj9pIwMVnHMLCTc8sbBNKS8ibtD/mlI+9Vj8C4gCoZ
ZRjMFnPMSC6RmoTWbDw8U28j0vxMbQ/SWrLNIgW44QUHyFPfBgWNwqqKux6b/Mph
u+SjVi/9ds8FKewLVi3dotdS8YmPF/b46Ov0ycfWLbyB7BvcP31o1zR1uLN6BqYj
bzI4n4hKOxT0SsA74odJJDamA60J/DW4tAGxyscKaq8pDFYlBFo9dq+9+/aoDAMj
sFLP32h/HqlO/ilZuuUVES4tg/shzF7VOhI9+GCvc/Ic1NXIdug4pUcXJ8ubXxzD
ObnvF8RX8Vwf/ofwjcHIE7sqJAT5/QZhB1RTg/SkdlaUczjle0gVgCN1hAqlNSCP
mJ8831lArg==
=YxBZ
-----END PGP SIGNATURE-----
Merge tag 'v0.21.21'
release v0.21.21
2020-03-19 15:26:27 +01:00
Rosen Penev
cade4e71c4
[clang-tidy] add [[nodiscard]]
...
Found with modernize-use-nodiscard
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-03-19 13:38:40 +01:00
Rosen Penev
403612c666
[clang-tidy] run through performance checks
...
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-03-19 13:38:40 +01:00
Rosen Penev
7fe49cf24d
[clang-tidy] use default member init
...
Found with modernize-use-default-member-init
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-03-19 13:38:40 +01:00
Rosen Penev
d2115e908a
[clang-tidy] remove redundant access specifiers
...
Found with readability-redundant-access-specifiers
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-03-19 13:38:40 +01:00
Max Kellermann
56c234b410
raise default "max_connections" value to 100
...
Documentation says the limit is 5, but it was really 10 (at least
since 2004). But since MPD wants to promote using many small clients
idling around, and these clients consume only very few resources, it
seems reasonable to raise this limit's default value.
2020-03-19 13:30:46 +01:00
Max Kellermann
61b5ab2663
thread/CriticalSection: remove extra semicolons
2020-03-17 16:57:57 +01:00
Rosen Penev
84f71cec2c
add two extra noreturn that clang picked up
...
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-03-16 23:02:35 -07:00
Rosen Penev
00b9f69c90
remove some more extra semicolons
...
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-03-16 13:37:13 -07:00
Rosen Penev
6d91b5c7b2
fix double promotions
...
Found with -Wdouble-promotion
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-03-16 12:43:24 -07:00
Max Kellermann
fd71514068
Merge remote-tracking branch 'neheb/h'
2020-03-16 17:29:05 +01:00
Max Kellermann
256cfc545d
Merge remote-tracking branches 'neheb/fwhfggwe', 'neheb/nvm2', 'neheb/nvm22', 'neheb/bvm' and 'neheb/cl2'
2020-03-16 17:25:50 +01:00
Rosen Penev
77c6c3fabf
remove unreachable code
...
Found with -Wunreachable-code-break
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-03-16 00:14:13 -07:00
Rosen Penev
e25a3d17e7
remove extra semicolon
...
Found with -Wextra-semi
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-03-16 00:13:20 -07:00
Rosen Penev
7f10e7a610
fix implicit-fallthrough warnings under clang
...
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-03-16 00:12:38 -07:00
Rosen Penev
88d56c01e7
fix missing overrides
...
Found with clang's -Winconsistent-missing-destructor-override
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-03-16 00:11:15 -07:00
Rosen Penev
97425d56e7
remove gcc_unused
...
[[maybe_unused]] (introduced in C++17) is standard C++.
https://clang.llvm.org/docs/AttributeReference.html#maybe-unused-unused
says that this is equivalent to the GNU unused attribute.
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-03-16 00:08:21 -07:00
Rosen Penev
0afb156a5b
remove gcc_warn_unused
...
[[nodiscard] (introduced in C++17) can be used instead.
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-03-16 00:08:21 -07:00
Rosen Penev
a192e7b29b
remove gcc_deprecated
...
[[deprecated]] (introduced in C++14) may be used instead.
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-03-16 00:08:21 -07:00
Rosen Penev
591f51f3d3
replace noreturn attribute with standard C++ version
...
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-03-16 00:08:18 -07:00
Rosen Penev
5e4b7e2fb7
[clang-tidy] fix incorrect rounding
...
Found with bugprone-incorrect-roundings
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-03-15 20:22:08 -07:00
Rosen Penev
177371a003
treewide: get rid of C math function usage
...
Boost does not seem to offer an overload for lrint.
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-03-15 20:22:07 -07:00
Rosen Penev
a78841d6a9
volume_mapping: get rid of exp10 workaround
...
exp10 is a GNU function, is not part of C++, and is not available
everywhere.
pow(10,x) is an alternative that works just as well. It is used in musl as
the implementation of exp10.
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-03-15 20:17:31 -07:00
Rosen Penev
3ec9fcfc44
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>
2020-03-15 20:17:31 -07:00
Max Kellermann
b5d1a09010
util/StringUtil: pass std::string_view to StringArrayContainsCase()
2020-03-13 20:38:40 +01:00
Max Kellermann
85b072b3d3
util/StringCompare: add StringIsEqual() with string_view
2020-03-13 20:36:48 +01:00
Max Kellermann
8a1f1fbe06
util/ASCII: migrate to std::string_view
2020-03-13 20:17:53 +01:00
Max Kellermann
45b60b3d38
fs/Traits: GetParent() returns std::string_view
2020-03-13 20:01:10 +01:00
Max Kellermann
cefc773992
playlist/PlaylistSong: pass std::string_view
2020-03-13 19:58:36 +01:00
Max Kellermann
a885bdba4c
fs/Traits: pass string_view to Build()
2020-03-13 19:55:28 +01:00
Max Kellermann
b6b15afb5a
fs/Path: make constructor explicit
2020-03-13 19:55:25 +01:00
Max Kellermann
1d560c8f0f
fs/AllocatedPath: add string_view
constructor
2020-03-13 19:46:29 +01:00
Max Kellermann
189f6eaa6f
fs/Traits: add string_view
2020-03-13 19:43:39 +01:00
Max Kellermann
87f78b9c39
fs/Traits: use {} notation for return values
2020-03-13 19:43:23 +01:00
Max Kellermann
aa722bd8ac
fs/Traits: use auto
2020-03-13 19:43:23 +01:00
Max Kellermann
58c7ec07a4
fs: use using
instead of typedef
2020-03-13 19:43:23 +01:00
Max Kellermann
3796247d6d
util/Stringview: use const_pointer
instead of hard-coding const char *
...
Fixes Windows build failure.
2020-03-13 19:43:23 +01:00
Max Kellermann
332f480ec3
util/UriExtract: uri_get_path() returns std::string_view
2020-03-13 18:54:41 +01:00
Max Kellermann
9a164668f2
util/UriExtract: migrate uri_get_scheme() to std::string_view
2020-03-13 18:51:11 +01:00
Max Kellermann
6876d160cf
util/StringCompare: add more StringView overloads
2020-03-13 18:49:47 +01:00
Max Kellermann
a63d0ee8fc
util/StringView: add method substr()
2020-03-13 18:48:40 +01:00
Max Kellermann
d4135935e4
lib/upnp/Util: remove unused function stringToTokens()
2020-03-13 17:59:07 +01:00
Max Kellermann
569773cc75
lib/upnp/Device: remove UPnPService::clear()
2020-03-13 17:56:29 +01:00
Rosen Penev
a2f5a63bbc
replace stdint.h with cstdint
...
The former is deprecated by C++14. The standard says they are the same:
The header defines all types and macros the same as the C standard library
header<stdint.h>.
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-03-12 19:04:39 -07:00
Rosen Penev
2db8bcc353
replace stddef.h with cstddef
...
The former is deprecated with C++14. The standard says both are the same:
The contents and meaning of the header<cstddef>are the same as the C
standard library header<stddef.h>,except that it does not declare the type
wchar_t, that it also declares the type byte and its associated
operations (21.2.5), and as noted in 21.2.3 and 21.2.4.
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-03-12 19:04:38 -07:00
Rosen Penev
c846ee0d1b
replace stdarg.h with cstdarg
...
The former was deprecated in C++14. The Standard says they are the same:
The contents of the header<cstdarg>are the same as the C standard library
header<stdarg.h>, with the following changes: The restrictions that ISO C
places on the second parameter to the va_start macro in header<stdarg.h>
are different in this International Standard. The parameter parmN is the
rightmost parameter in the variable parameter list of the function
definition (the one just before the...).219If the parameter parmN is a
pack expansion (17.5.3) or an entity resulting from a lambda capture
(8.1.5), the program is ill-formed, no diagnostic required. If the
parameter parmN is of a reference type, or of a type that is not
compatible with the type that results when passing an argument for which
there is no parameter, the behavior is undefined.
Also changed va_list to the std:: namespace version, which is the same.
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-03-12 19:03:12 -07:00
Rosen Penev
69a51e12c9
replace signal.h with csignal.h
...
The former was deprecated with C++14. The standard says they are the same:
The contents of the header<csignal>are the same as the C standard library
header<signal.h>.
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-03-12 18:56:51 -07:00
Rosen Penev
4b57b7f5a5
replace limits.h with climits
...
The former was deprecated with C++14. The standard says they are the same
with one exception:
The header<climits>defines all macros the same as the C standard library
header<limits.h>.
[Note:The types of the constants defined by macros in<climits>are not
required to match the types to which themacros refer.— end note]
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-03-12 16:14:04 -07:00
Rosen Penev
5cd400f578
replace inttypes.h with cinttypes
...
The former has been deprecated by C++14. They are also the same.
From the standard:
The contents and meaning of the header<cinttypes>are the same as the C
standard library header<inttypes.h>, with the following changes:
-The header<cinttypes>includes the header<cstdint>instead of<stdint.h>,and
—if and only if the typeintmax_tdesignates an extended integer type
(6.7.1), the following functionsignatures are added:intmax_t
abs(intmax_t);imaxdiv_t div(intmax_t, intmax_t);which shall have the same
semantics as the function signaturesintmax_t imaxabs(intmax_t)andimaxdiv_t
imaxdiv(intmax_t, intmax_t), respectively.
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-03-12 16:07:28 -07:00
Rosen Penev
edc4989d9c
change errno.h to cerrno
...
The former is deprecated by C++14. It's also functionally the same.
From the standard:
19.4
The header<cerrno>is described in Table 43. Its contents are the same as
the POSIX header<errno.h>,except that errno shall be defined as a macro.
[Note: The intent is to remain in close alignment with the POSIX
standard.] A separate errno value shall be provided for each thread.
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-03-12 15:51:16 -07:00
Rosen Penev
2b3d6461e3
remove unused ctype.h header
...
None of the functions in these files come from ctype.h
Also changed one instance of isdigit to the C++ variant.
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-03-12 15:43:50 -07:00
Rosen Penev
ab9f5d2067
replace assert.h with cassert
...
The former was deprecated with C++14.
According to the C++11 and C++17 standards, both files are identical.
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-03-12 15:25:38 -07:00
Max Kellermann
82743dfd02
playlist/asx: concatenate multiple CharacterData fragments
...
Similar to c45f113856
2020-03-12 21:07:37 +01:00
Rosen Penev
f00f8b002a
[clang-tidy] use nodiscard
...
Introduced in C++17. It replaces gcc's warn_unused_result.
Found with modernize-use-nodiscard.
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-03-12 12:59:16 -07:00
Max Kellermann
33694642bd
playlist/asx: add State::TAG
2020-03-12 20:42:16 +01:00
Max Kellermann
c71242d743
playlist/asx: use tag_table to convert element name to TagType
2020-03-12 20:40:18 +01:00
Max Kellermann
2229e86673
client/Expire: cancel the BackgroundCommand before deleting it
...
Fixes assertion failure.
Closes https://github.com/MusicPlayerDaemon/MPD/issues/774
2020-03-12 20:32:08 +01:00
Max Kellermann
f24c274f5c
client/BackgroundCommand: fix typo in comment
2020-03-12 20:32:07 +01:00
Max Kellermann
3824bf66ca
lib/chromaprint/DecoderClient: add assertion
2020-03-12 20:32:07 +01:00
Max Kellermann
d942f874ae
lib/chromaprint/DecoderClient: check ready
in GetCommand()
...
Fixes access to uninitialized memory (`remaining_bytes` isn't
initialized until Ready() is called) and fixes spurious
`getfingerprint` failures.
2020-03-12 20:31:46 +01:00
Max Kellermann
01632d37ef
Merge branch 'v0.21.x'
2020-03-12 08:11:08 +01:00
Max Kellermann
c45f113856
playlist/xspf: concatenate multiple CharacterData fragments
...
Closes https://github.com/MusicPlayerDaemon/MPD/issues/781
2020-03-12 08:02:58 +01:00
Max Kellermann
e0a8fd398c
playlist/xspf: add State::TAG
2020-03-12 08:00:54 +01:00
Max Kellermann
3e97058151
playlist/xspf: move location.empty() check to _start_element()
2020-03-11 20:54:53 +01:00
Max Kellermann
51b1dd8672
playlist/xspf: use tag_table to convert element name to TagType
2020-03-11 20:51:47 +01:00
Max Kellermann
98a7d8da6c
playlist/xspf: use C++11 initializer
2020-03-11 20:51:10 +01:00
Max Kellermann
acb29f792f
tag/Mask: fix yet another typo, this time in Unset()
...
Similar to commits e8f2f98048
and
ff1ff1e54a
Closes https://github.com/MusicPlayerDaemon/MPD/issues/783
2020-03-11 20:34:02 +01:00
Max Kellermann
8d34a1cfc6
archive/iso9660: skip empty filenames
...
Aparently, libcdio sometimes returns empty filenames, causing MPD
crashes. This shouldn't really happen, and I consider this a libcdio
bug - but if it happens, people blame MPD, so let's add a check.
Closes https://github.com/MusicPlayerDaemon/MPD/issues/776
2020-03-07 09:30:56 +01:00
Max Kellermann
73a1f078a6
archive/iso9660: use IsSpecialFilename()
2020-03-07 09:30:56 +01:00
Max Kellermann
b7ce452308
fs/Traits: add IsSpecialFilename()
...
Merge some duplicate code in a central library.
2020-03-07 09:30:56 +01:00
Thomas Klausner
7a68b1e71f
Adapt SolarisOutputPlugin.cxx to be usable on NetBSD.
2020-02-29 10:05:29 +01:00
Thomas Klausner
d5468dfe89
Add missing header.
...
Fixes
../src/time/ISO8601.cxx:67:24: error: use of undeclared identifier 'strtoul'
unsigned long value = strtoul(s, &endptr, 10);
^
../src/time/ISO8601.cxx:77:14: error: use of undeclared identifier 'strtoul'
minutes = strtoul(s, &endptr, 10);
^
on NetBSD with clang 9.0.0.
2020-02-29 10:04:54 +01:00
John Regan
976372ff63
gme: check for empty metadata strings instead of nullptr
...
Using libgme 0.6.2 on macOS, it appears that gme_info_t strings can be
empty, which creates weird track titles: (001/050)
This adds an additional check for an empty string.
2020-02-25 20:12:08 +01:00
Max Kellermann
c977d646c7
Merge remote-tracking branches 'neheb/j', 'neheb/f', 'neheb/qwe' and 'neheb/hgf'
2020-02-20 16:58:17 +01:00
Rosen Penev
ac50bb5d2b
[clang-tidy] remove needless std::move
...
Found with performance-move-const-arg
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-02-20 16:47:34 +01:00
Max Kellermann
85e33f7d60
lib/dbus/Udisks2: make path
non-const to allow moving from it
2020-02-20 16:47:32 +01:00
Max Kellermann
7646866a32
neighbor/smbclient: make iterators non-const to enable the std::move()
2020-02-20 16:47:32 +01:00
Max Kellermann
d072b3cb17
storage/smbclient: remove misplaced .c_str() call
2020-02-20 16:47:32 +01:00
Max Kellermann
646fef108a
storage/composite: make variable non-const to enable the std::move()
2020-02-20 16:41:38 +01:00
Max Kellermann
d1cc73775f
Instance: flush input cache on SIGHUP
2020-02-17 15:23:05 +01:00
Max Kellermann
29d05cdb8e
unix/SignalHandlers: pass Instance to ...Init()
2020-02-17 15:23:03 +01:00
Rosen Penev
351a4a80d2
[clang-tidy] use using instead of typedef
...
Found with modernize-use-using
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-02-16 19:22:32 -08:00
Rosen Penev
87f7b0f0bb
[clang-tidy] use emplace_back
...
Found with hicpp-use-emplace
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-02-16 19:21:55 -08:00
Rosen Penev
6d3190fe5f
[clang-tidy] use = default
...
Found with modernize-use-equals-default
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-02-16 17:10:18 -08:00
Rosen Penev
5d787806fe
[clang-tidy] add ending namespace comments
...
Found with llvm-namespace-comment
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-02-16 16:44:37 -08:00
Max Kellermann
dea0cc165d
input/cache/Manager: add method Flush()
2020-02-16 20:46:24 +01:00
Max Kellermann
07e0a31d02
release v0.21.20
...
-----BEGIN PGP SIGNATURE-----
iQJEBAABCgAuFiEEA5IzWngIOJSkMBxDI26KWMbbRRIFAl5Jm2cQHG1heEBtdXNp
Y3BkLm9yZwAKCRAjbopYxttFEj3nEACkdgWh02NT0EGpmumCn4cB1mZ78ef0GyGm
OOJi6qrnfuQdFX89UlL1+Nrx1U4Q6O6XvlIuuWTdKUjRQ+g5ktWuN48uEIKJ38If
5ZbAqEZOvrH2b2lHNX15v7OvwXeGYK28fBbAjKf7txOJtW86azZ3NTjn4bb2a77B
cio+Rhj9+fXzx/nBxHGVhLY3OQWQySFTm2Nbaz6zQoQYgm2xZ0htHNsGYKV6nl8I
2Xt5zPEIlbjqdK9moSL1qyCevLZc7ME1Ha1v45pLwrXeCKlqhr5+6xFe2BEc1+DZ
NHVmVs4e0GqSnyNTEd8eHXn70lpJ5ZSfrrk/HIHkx0Jk2hoGmAasHIUQViYxBiMN
LqET7vM9nslrvuHl1Dd7wE66rrkGW6ILYKB7w48Jw00W5BjBtgcEVSj3PoKwchdh
m4+JNZFJvubrXFKWjuXfRtY3MXsDKfy7lMd0iXDAxjh0YJuC8VGpGwRLL4V2uEzs
tr2UvWIpjlw96kvvjTDnJp5kjA7D77xomxNkCHmj2/LOsA/bd4ljoCcmX033DBRr
b7ddcESVcqTYXtMnYSWxmcHqizGjwIAVr7SsRgNbzZzs0/DVNpFAb/tGz3K9DzzF
vdpm3y5KqdGyVoMAsIZDsxannmxcpivI6iOITAQH5aIRSLN/8ZGzCZ6ucS2GTjwq
TZUR7iOjVQ==
=ejSV
-----END PGP SIGNATURE-----
Merge tag 'v0.21.20'
release v0.21.20
2020-02-16 20:46:13 +01:00
Max Kellermann
36a678276b
storage/composite: no "=default" in constructor
...
Closes https://github.com/MusicPlayerDaemon/MPD/pull/739 (essentially
the same, but with a proper explanation)
2020-02-16 19:07:08 +01:00
Max Kellermann
d4a6d647a0
Merge branch 'efuhgeh' of git://github.com/neheb/MPD
2020-02-16 19:03:35 +01:00
Max Kellermann
5397d18ed9
protocol/ArgParser: cast seek offset to SignedSongTime
...
"The issue is that ParseCommandArgSignedSongTime parses with
SongTime::FromS, not SignedSongTime::FromS, before casting back to a
SignedSongTime for the return. With x86 overflow rules this doesn't
matter, but on ARM the first cast turns negative values to zero."
Closes https://github.com/MusicPlayerDaemon/MPD/issues/757
2020-02-10 09:18:37 +01:00
Max Kellermann
2d3b51665e
util/BitReverse: generate table with constexpr function
...
Get rid of the macro hell.
2020-02-05 19:51:46 +01:00
Max Kellermann
7b03f55cb4
util/bit_reverse: convert to C++
2020-02-05 19:49:18 +01:00
Max Kellermann
b84444b680
archive/iso9660: rewrite the macro CEILING as function
2020-02-05 19:43:20 +01:00
Max Kellermann
1e421cbcb2
Merge remote-tracking branches 'neheb/patch-2', 'neheb/con', 'neheb/cons', 'neheb/guruhg', 'neheb/r12R3', 'neheb/fefgheh' and 'neheb/rhgerg3453'
2020-02-05 19:36:01 +01:00
Rosen Penev
a4eed3e330
[clang-tidy] use forward instead of move
...
Found with bugprone-move-forwarding-reference
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-02-04 18:31:00 -08:00
Rosen Penev
b9db8ddee6
[clang-tidy] remove misplaced const
...
The rhs evaluates to void *const, not const void*.
Found with misc-misplaced-const
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-02-04 15:27:14 -08:00
Rosen Penev
9cf1385765
[clang-tidy] remove static in namespace
...
Found with readability-static-definition-in-anonymous-namespace
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-02-04 15:25:31 -08:00
Rosen Penev
a3963de668
[clang-tidy] change integer prefixes to uppercase
...
Found with readability-uppercase-literal-suffix
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-02-04 15:20:50 -08:00
Rosen Penev
7d2c4ec775
[clang-tidy] remove unneeded return
...
Found with readability-redundant-control-flow
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-02-04 15:19:52 -08:00
Rosen Penev
1de5bd64d8
[clang-tidy] remove const in declaration
...
Found with readability-avoid-const-params-in-decls
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-02-04 15:17:10 -08:00
Rosen Penev
1923cf3844
remove redundant const qualification
...
Found with readability-const-return-type
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-02-04 15:16:28 -08:00
Max Kellermann
8e4cb3217e
lib/xiph/OggSyncState: fix offset counter by using the actual page size
2020-02-04 21:38:08 +01:00
Max Kellermann
7bcccbedad
Merge remote-tracking branches 'neheb/bind', 'neheb/move' and 'neheb/str'
2020-02-04 17:03:49 +01:00
Max Kellermann
7c62887df7
tag/ApeTag: don't take reference of IterableSplitString() elements
...
This doesn't work because IterableSplitString() returns its elements
by value.
Fixes clang warning:
loop variable 'i' is always a copy because the range of type 'IterableSplitString' (aka 'BasicIterableSplitString<char>') does not return a reference [-Werror,-Wrange-loop-analysis]
2020-02-04 16:53:45 +01:00
Max Kellermann
3fc859c42d
Merge branch 'v0.21.x'
2020-02-04 16:49:18 +01:00
Max Kellermann
50003f6ad2
decoder/ffmpeg: add two more missing commas
2020-02-04 16:30:05 +01:00
Rosen Penev
0914644d2b
add missing comma
...
Found with bugprone-suspicious-missing-comma
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-02-04 16:29:23 +01:00
Rosen Penev
7e41c4de58
[clang-tidy] use == instead of compare for strings
...
Found with readability-string-compare
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-02-02 20:11:25 -08:00
Rosen Penev
452c41b71f
[clang-tidy] convert several functions to const &
...
Found with performance-unnecessary-value-param
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-02-02 13:21:27 -08:00
Max Kellermann
4b0444e760
Merge remote-tracking branches 'neheb/uniq', 'neheb/bool', 'neheb/loop', 'neheb/bool2', 'neheb/perf', 'neheb/void' and 'neheb/value'
2020-02-02 16:22:19 +01:00
Rosen Penev
ecad6d936a
[clang-tidy] pass by value where appropriate
...
Found with modernize-pass-by-value
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-02-01 19:53:44 -08:00
Rosen Penev
568deefd68
[clang-tidy] remove pointless void arg
...
Found with modernize-redundant-void-arg
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-02-01 19:52:38 -08:00
Rosen Penev
40d0420648
[clang-tidy] convert several loops to const auto&
...
Found with performance-for-range-copy
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-02-01 19:49:17 -08:00
Rosen Penev
afb29942b0
[clang-tidy] simplify boolean expressions
...
Found with readability-simplify-boolean-expr
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-02-01 19:47:47 -08:00
Rosen Penev
15fa780c99
[clang-tidy] convert several loops to range based ones
...
Found with modernize-loop-convert
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-02-01 19:46:50 -08:00
Rosen Penev
9db3809c7b
[clang-tidy] use bool literals where appropriate
...
Found with modernize-use-bool-literals
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-02-01 19:45:33 -08:00
Rosen Penev
dfed9546aa
[clang-tidy] replace std::bind with lambdas
...
Found with modernize-avoid-bind
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-02-01 19:43:01 -08:00
Rosen Penev
469cd9582f
[clang-tidy] use make_unique
...
Found with modernize-make-unique
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-02-01 19:40:39 -08:00
Max Kellermann
bc6eca2115
*: add explicit
2020-02-01 14:02:43 +01:00
Max Kellermann
72ec641f0d
*: use auto
2020-02-01 14:02:43 +01:00
Max Kellermann
4f22f4d357
*: use nullptr instead of NULL
2020-02-01 14:02:43 +01:00
Max Kellermann
4c52001a35
*: use defaulted destructors
2020-02-01 13:47:16 +01:00
Max Kellermann
302eff0a59
decoder/{vorbis,mpcdec}: use using
instead of typedef
2020-02-01 13:38:43 +01:00
Max Kellermann
bcc4e97c60
pcm/PcmFormat: use using
instead of typedef
2020-02-01 13:38:19 +01:00
Max Kellermann
4968dd4faa
pcm/Dither: use using
instead of typedef
2020-02-01 13:38:00 +01:00
Max Kellermann
0896f44455
util/Domain: add noexcept
2020-02-01 13:25:57 +01:00
Max Kellermann
620872390b
util/Exception: move the forwarded std::exception_ptr
2020-02-01 13:13:08 +01:00
Max Kellermann
f7c326dbeb
net/StaticSocketAddress: make the cast operators constexpr
2020-02-01 11:49:55 +01:00
Max Kellermann
50de3a7886
net/AddressInfo: add MakeAddrInfo()
2020-02-01 11:48:15 +01:00
Max Kellermann
36cad54ccd
util/TemplateString: remove stray semicolon
2020-02-01 11:46:06 +01:00
Max Kellermann
5ad6e7fec5
decoder/{audio,snd}file: handle MIME type "audio/wav"
2020-02-01 11:26:57 +01:00
Rosen Penev
0bb943ba3e
FfmpegDecoderPlugin: add WAV support
2020-02-01 11:24:51 +01:00
Rosen Penev
b64fdae938
[clang-tidy] use override instead of virtual
...
Found with modernize-use-override
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-01-31 21:27:26 -08:00
Rosen Penev
80a0cf694f
MadDecoderPlugin: fix bad printf format
...
max_frames is size_t, not unsigned long. Fixes GCC warning.
2020-01-31 21:21:39 +01:00
Max Kellermann
0b2444450f
decoder/ogg: improve seeking accuracy using binary search
...
On some VBR files, the single-step interpolation was very inaccurate
and inacceptable.
Closes https://github.com/MusicPlayerDaemon/MPD/issues/720
2020-01-31 19:35:35 +01:00
Max Kellermann
faf149d08e
lib/xiph/OggVisitor: add method ReadGranulepos()
2020-01-31 19:32:38 +01:00
Max Kellermann
e01bbad7bb
lib/xiph/OggVisitor: update the OggStreamState offset
2020-01-31 19:24:41 +01:00
Max Kellermann
7e3eaa5921
lib/xiph/OggSyncState: keep track of the Reader offset
2020-01-31 19:24:34 +01:00
Max Kellermann
6fe4068c8e
decoder/ogg: move code to SeekByte()
2020-01-31 19:24:26 +01:00
Max Kellermann
8472135859
decoder/ogg: remove unimplemented Seek() declaration
2020-01-31 19:20:52 +01:00
Max Kellermann
943a67c805
decoder/ogg: need to sync small files while looking for EOS
...
When calling OggSeekFindEOS() from inside a OggVisitor callback, then
the #InputStream may be in the middle of an Ogg packet, and the newly
initialized #ogg_sync_state will not be able to load it without the
help of ogg_sync_pageseek(). By passing "synced=false" to
OggSeekFindEOS(), we force the use of ogg_sync_pageseek() even when
not actually seeking.
Closes https://github.com/MusicPlayerDaemon/MPD/issues/719
2020-01-25 20:07:11 +01:00
Max Kellermann
881d91f86b
lib/xiph/OggFind: add parameter "synced"
2020-01-25 20:07:10 +01:00
Max Kellermann
1e07d15428
output/Control: add missing nullptr check to LockRelease()
2020-01-20 17:34:38 +01:00
Max Kellermann
cc7f66822e
command/partition: add command "delpartition"
2020-01-20 14:56:31 +01:00
Max Kellermann
9cbfa66886
command/partition: don't create null output in new partitions
...
No output at all is fine. If the partition needs an output, it must
be moved there, but having just a null output isn't helpful.
2020-01-20 14:55:10 +01:00
Max Kellermann
4df98466df
output/multiple: add "client" field, replacing the "client" parameter
...
By eliminating GetAnyClient(), we can have instances with no outputs
at all.
2020-01-20 14:51:08 +01:00
Max Kellermann
49309b419f
Partition: add a local idle_monitor
...
Make idle events per-partition, but leave Instance::EmitIdle() and its
underlying idle_monitor which broadcasts idle events to all
partitions.
2020-01-20 13:33:01 +01:00
Max Kellermann
879bafb837
Instance: move OnIdle() to Instance.cxx
2020-01-20 13:32:43 +01:00
Max Kellermann
6fcea2d484
Instance: move code to OnStateModified()
2020-01-20 13:28:00 +01:00
Max Kellermann
5d597a3646
Instance: manage StateFile with std::unique_ptr
2020-01-20 13:25:19 +01:00
Max Kellermann
56eaf000a4
Partition: add client list
...
For efficient traversal within one partition, e.g. for distributing
partition-local idle events.
2020-01-20 13:16:13 +01:00
Max Kellermann
77271ebc1f
Partition,Instance: add EmitIdle() documentation
2020-01-20 12:50:48 +01:00
Max Kellermann
fd2b2cf0bc
command/message: make messages/subscriptions local to the current partition
2020-01-20 12:47:57 +01:00
Max Kellermann
438a6d7595
client/Client: make several getter methods const
2020-01-20 12:47:57 +01:00
Max Kellermann
00ed836aa9
Instance: remove partitions loop from {Found,Lost}Neighbor()
...
These are global events.
2020-01-20 12:18:43 +01:00
Max Kellermann
5afec8256a
Main: move code to Partition::BeginShutdown()
2020-01-20 09:22:28 +01:00
Max Kellermann
f249a755e2
command/player: show partition name in "status" response
2020-01-18 23:31:39 +01:00
Max Kellermann
4029a79dc2
command/player: add local Partition reference variable
2020-01-18 23:30:45 +01:00
Max Kellermann
c16233fa74
add "moveoutput" command
2020-01-18 22:21:27 +01:00
Max Kellermann
ac126ede22
client/Client: emit idle flags in SetPartition()
2020-01-18 22:21:27 +01:00
Max Kellermann
7732db0aee
output/Control: move code to method StopThread()
2020-01-18 21:46:18 +01:00
Max Kellermann
37f984ba74
output/Control: avoid sending KILL twice
2020-01-18 21:43:17 +01:00
Max Kellermann
cd612c4eef
AudioFormat: move to pcm/
2020-01-18 20:24:59 +01:00
Max Kellermann
914ad261ed
pcm/meson.build: split libpcm into two
...
One basic library without dependencies, and one with heavy
dependencies like libsamplerate.
2020-01-18 20:08:23 +01:00
Max Kellermann
7551867249
meson.build: move Log.cxx and LogBackend.cxx into a static library
...
Prevents compiling those sources many times, once for each debug
program using it.
2020-01-18 19:56:16 +01:00
Max Kellermann
bdd3167495
tag/ApeLoader: remove exception handler, let caller catch
2020-01-18 19:51:46 +01:00
Max Kellermann
526c778162
tag/Id3Scan: remove exception handler, let caller catch
...
There's just one caller, i.e. ScanGenericTags(), which is documented
to throw exceptions.
2020-01-18 19:50:02 +01:00
Max Kellermann
e01bddbd86
output/MultipleOutputs: update API documentation
2020-01-18 19:23:49 +01:00
Max Kellermann
2817bf9e95
copyright year 2020
2020-01-18 19:23:49 +01:00
Max Kellermann
a37d22de8a
pcm/Convert: choose pcm2dsd float/integer according to dest_format
2020-01-17 19:15:44 +01:00
Max Kellermann
452e1c1a6f
pcm/Convert: throw if !ENABLE_DSD
2020-01-17 19:15:28 +01:00
Max Kellermann
8db86e2820
Revert "pcm/Convert: add option to enable the integer-only dsd2pcm implementation"
...
This reverts commit c84bae739a
. A
configuration option is not necessary, because the PcmConvert
constructor knows already whether integer or floating point is needed.
2020-01-17 19:11:10 +01:00
Max Kellermann
c84bae739a
pcm/Convert: add option to enable the integer-only dsd2pcm implementation
2020-01-17 16:37:09 +01:00
Max Kellermann
925b5954c3
pcm/Dsd2Pcm: add integer-only implementation
2020-01-17 16:17:32 +01:00
Max Kellermann
dca79938d5
release v0.21.19
...
-----BEGIN PGP SIGNATURE-----
iQJEBAABCgAuFiEEA5IzWngIOJSkMBxDI26KWMbbRRIFAl4hyV4QHG1heEBtdXNp
Y3BkLm9yZwAKCRAjbopYxttFEndhD/0SFrzS6I8+9Tsz4f3tAhKH9qaHCepZLJ6o
kpv/qYbbVsIWLtYJtteNi9JTa17MI0s8GgR3/OeEUwmfTdy/HFKrRjT5ptGy2lmk
OBH34vgQsOPIRsdba6UqWHgLFYBwGm3CoCnwKwxGD2ZhCQt7UC7GWxVh70AX6ncj
sWlYtXbabfS1V+vGhiS4o0yNFHLsyxXPAGvaf5gHkP5OT+kJDYgv3YlIHzEKmoiO
xf2pQtvq62YLPXyBR2FEklBN/H6l13e7HZYeTLli6fPUFJIgslI6wgCh4mlvPyx7
7/PXuQjYOfoMtZRsFKo+V84KzIsHQvnhuusFb1iXZnWIYfSzYR09MlTirGEyGEqd
rEZxw9J00TDSWqOnAFOR1ThsgmtAabGT2On1N1ultvvbOLsyiW/N1Vrp7MuNzWK1
Fe9ICwucJztWHcnR2GR0vlnzXvN3bQBadQMRH0Gh3DZGTso3VEOlvkzlcyQNrzZ5
JeIOUtp83mAOnBe2CzP12KMbWF2OYTuX9IjHQpRftpzSnv1IPgvgIBJ9hUD71l3n
Io4LJfkrLtnMU9Y0l8nB4ri9wq9yOkWiKsdpDzWWWqCaRkKcB93CGXyPA53gYbTS
vD/HaYC4qHkUg5SeBHiH/FDjbLAaM+1G1btctVNMIuSBtBsIjpa8yerppTx7pCfZ
UDjOGZeqCg==
=hNuk
-----END PGP SIGNATURE-----
Merge tag 'v0.21.19'
release v0.21.19
2020-01-17 15:58:11 +01:00
Max Kellermann
4f11fa0d41
config/File: allow overriding top-level settings in includes
...
Remove the error message and instead erase the old setting if the
"repeatable" flag is not set.
https://github.com/MusicPlayerDaemon/MPD/issues/684
2020-01-17 14:58:40 +01:00
Max Kellermann
235b6980b8
pcm/Dsd2Pcm: add optimized stereo version
...
This code path is 2% faster.
2020-01-14 23:38:46 +01:00
Max Kellermann
ee46150329
pcm/Dsd2Pcm: add class MultiDsd2Pcm
2020-01-14 23:29:03 +01:00
Max Kellermann
79c585bf03
pcm/PcmDsd: use size_t
2020-01-14 23:28:34 +01:00
Max Kellermann
becd81f771
pcm/PcmDsd: manage Dsd2Pcm instances, not pointers
2020-01-14 23:26:34 +01:00
Max Kellermann
2073a2c1b0
pcm/Dsd2Pcm: remove unused "lsbf" flag
2020-01-14 23:20:45 +01:00
Max Kellermann
3f3104348e
pcm/Dsd2Pcm: add "restrict" attribute
2020-01-14 23:20:36 +01:00
Max Kellermann
7e80c62c7c
util/GenerateArray: use double curly braces for compatibility
2020-01-14 23:16:46 +01:00
Max Kellermann
4038d8527f
pcm/Dsd2Pcm: eliminate "& 0xff"
2020-01-14 22:56:28 +01:00
Max Kellermann
3565f0c8ce
pcm/Dsd2Pcm: move code to TranslateSample()
...
10% speedup. Strange, huh?
2020-01-14 22:51:20 +01:00
Max Kellermann
9647b2cb01
pcm/Dsd2Pcm: move code to ApplySample()
...
For some reason, this speeds up the library by 2%.
2020-01-14 22:43:11 +01:00
Max Kellermann
2d5bf53240
pcm/Dsd2Pcm: use sizet_t
instead of int
2020-01-14 22:40:54 +01:00
Max Kellermann
a65f7b1006
pcm/Dsd2Pcm: use std::fill_n()
2020-01-14 22:39:54 +01:00
Max Kellermann
bc5b647053
pcm/Dsd2Pcm: use sizet_t
instead of unsigned
2020-01-14 22:37:30 +01:00
Max Kellermann
1708ae3e3c
pcm/Dsd2Pcm: use uint8_t
instead of unsigned char
2020-01-14 22:36:50 +01:00
Max Kellermann
6bfbc5d320
pcm/Dsd2Pcm: move code to CalcOutputSample()
2020-01-14 22:25:54 +01:00
Max Kellermann
e7483bc5bc
pcm/Dsd2Pcm: make variables more local
2020-01-14 22:21:32 +01:00
Max Kellermann
b911ec1a29
pcm/Dsd2Pcm: convert to class
2020-01-14 22:16:02 +01:00
Max Kellermann
ca2633bf26
pcm/Dsd2Pcm: remove unused function dsd2pcm_clone()
2020-01-14 22:15:05 +01:00