Commit Graph

13307 Commits

Author SHA1 Message Date
Max Kellermann
79fd6143ec lib/dbus/Values: use T::Traits, not T
This template was never instantiated, so the problem never occurred.
2020-11-30 22:11:18 +01:00
Max Kellermann
8f89e3f7f4 lib/dbus/Values: use using instead of typedef 2020-11-30 22:11:14 +01:00
Max Kellermann
fc01d11b8d odbus/Types: use using instead of typedef 2020-11-30 22:08:37 +01:00
Max Kellermann
0c28d8dcbe time/ISO8601: support YYYY-MM (without day of month) 2020-11-30 21:55:12 +01:00
Max Kellermann
764eaadd25 time/Math: new library 2020-11-30 21:55:05 +01:00
Max Kellermann
273771ffec net/SocketAddress: add CastTo() 2020-11-30 21:51:07 +01:00
Max Kellermann
32ce9ce919 net/IPv[46]Address: pass SocketAddress by value to Cast() 2020-11-30 21:49:07 +01:00
Max Kellermann
34a070f5a6 net/IPv[46]Address: add Cast(const sockaddr_in&) 2020-11-30 21:49:02 +01:00
Danilo Spinella
92bfdffa42 lib/ffmpeg/Filter: Add define required for avutil 2020-11-30 20:06:21 +01:00
Max Kellermann
ac4975cd7a util/MimeType: relicense to BSD-2 2020-11-18 15:28:21 +01:00
Max Kellermann
fbbbfb9668 Merge branch 'v0.22.x' 2020-11-16 09:41:20 +01:00
Max Kellermann
38b41fc3fd filter/ffmpeg: detect the output sample format
Some FFmpeg filters change the sample format, and since MPD assumes
this never happens, this results in loud noise instead of music.  This
commit finally implements the TODO comment by sending one frame of
silence to the filter and checking the output frame's format.

Closes https://github.com/MusicPlayerDaemon/MPD/issues/1009
2020-11-16 09:39:34 +01:00
Max Kellermann
394f69bee1 output/Control: allow copy elision (fix -Wpessimizing-move) 2020-11-15 19:55:11 +01:00
Stapper
ba5531f9dd Fixes #994 - moveoutput: new AudioOutputControl created from copyMoving an output to a partition is now done via MultipleOutputs::AddCopy(),using a new AudioOutputControl constructor. Tags and always_on settings willpersist when moving outputs between partitions. 2020-11-15 19:47:53 +01:00
Max Kellermann
eb9f5339b6 Merge branch 'v0.22.x' into master 2020-11-11 12:43:50 +01:00
Max Kellermann
a9714e73c8 Merge branch 'bind' of git://github.com/neheb/MPD into master 2020-11-10 16:02:34 +01:00
Max Kellermann
1092882f38 decoder/dsdiff: apply padding to odd-sized chunks
Closes https://github.com/MusicPlayerDaemon/MPD/issues/1001
2020-11-10 15:55:33 +01:00
Max Kellermann
a99bc91eb0 release v0.22.3
-----BEGIN PGP SIGNATURE-----
 
 iQJEBAABCgAuFiEEA5IzWngIOJSkMBxDI26KWMbbRRIFAl+lZ/cQHG1heEBtdXNp
 Y3BkLm9yZwAKCRAjbopYxttFEpfmD/wPsQl/bLHuU1su2OqOAtFfPEhkJAetllE5
 vpkXUqATEiBFKTDj2tpherZsioGpExoNmypgehVp0oDSuWvF+wbYf+SNpsqW4Ck0
 +RoOg1Nr5tKtjc7dCQA8AricguR4nU9ecfXPKU/Q62AJbdlUhi5Ly4QcFyT3NZUK
 SK0yp4i83osWMEAEhn1k7ducqljSyjIBt1dvK3FK9JY3lYXXARVG5THDnlbbXhxP
 Hn9Jygd7bJ3J3g0I45q4Nfop7BiPBowmiqDxe6scL/owW+5MXlC+nkX1OIYRA37E
 Byud/kV5/gi5YyK4Z6hNI5p1By4ggJ8N5O7h2CiktMvkd4KQMUm4SfMH3ah3o2JG
 CiC90WgwdWeTbRaZvSKWSPo3V2htbzObeglvyUjnmV2HTNN0vRWzS5vrbvWK81+R
 XMqICrJNwlQduCNbl1UcnCdIN+0tS1Ecg8xEDkbe6VVHAoxwIsWASYgKr3fxXnuQ
 N2vWkqLXHrgJWtpVU8aP2ufnkbHDWA1T1vgPsgNUKv/vEQAaRP0XkMIc+VW3u8H8
 AWj87r+qxjjWCfAbg9nxdGzen+KHZnq0/hiPLq1C2skm4JP+LsWuI4mjB/oGfJ6y
 aZsXHxCV/aKakDucpmkMfC/oYnXD+dvBXTgIr68teEuLnmLauZa3oXocdRqQdCUW
 qKh9rVD7vg==
 =FEmy
 -----END PGP SIGNATURE-----

Merge tag 'v0.22.3' into master

release v0.22.3
2020-11-06 16:14:46 +01:00
Max Kellermann
f849b07766 storage/curl: fix nullptr dereference
Pass a std::string to PathTraitsUTF8::Relative(), implicitly casting
it to std::string_view.  This selects the right overload which returns
std::string_view instead of `const char *`; the latter could return
`nullptr` which would cause the implicit conversion of the return
value to std::string_view to crash.

Regression caused by commits ead208987d and a98d627c0b.

Closes https://github.com/MusicPlayerDaemon/MPD/issues/995
2020-11-06 15:35:47 +01:00
Rosen Penev
071d3c71d8
clang-tidy: replace std::bind with lambdas
Found with modernize-avoid-bind

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-11-05 18:09:30 -08:00
Max Kellermann
afbcac9fb1 util/MimeType: use IterableSplitString() in ParseMimeTypeParameters() 2020-11-04 21:29:42 +01:00
Max Kellermann
51e5b56b3a playlist/registry: remove duplicate function ExtractMimeTypeMainPart()
This is the same as GetMimeTypeBase(), which has already been applied.
2020-11-04 21:20:43 +01:00
Max Kellermann
bb07fd42ce util/MimeType: migrate GetMimeTypeBase() to std::string_view 2020-11-04 21:20:03 +01:00
Max Kellermann
bab626c325 util/UriExtract: remove the query string at the beginning of uri_get_suffix() 2020-11-04 21:15:41 +01:00
Max Kellermann
2a9131498f util/UriExtract: pass std::string_view to uri_get_suffix() 2020-11-04 21:13:57 +01:00
Max Kellermann
35a232105e util/UriExtract: uri_get_suffix() returns std::string_view
No need to copy it to a buffer.
2020-11-04 21:08:26 +01:00
Max Kellermann
19dd1a25d7 {decoder,archive,playlist}/plugin: pass std::string_view to SupportsMimeType() 2020-11-04 21:00:49 +01:00
Max Kellermann
53396c0e50 Merge branch 'v0.22.x' into master 2020-11-04 20:37:25 +01:00
Max Kellermann
0b8208fe7f Merge branch 'clng11' of git://github.com/neheb/MPD into master 2020-11-04 20:34:55 +01:00
Max Kellermann
2da3cff1e8 filter/LoadChain: use the AutoConvertFilter
This adds support for input samples other than 16 bit to the FFmpeg
filter plugin.
2020-11-04 20:15:19 +01:00
Max Kellermann
0c965d0573 filter/AutoConvert: move the Filter class to TwoFilters.cxx 2020-11-04 20:15:19 +01:00
Max Kellermann
77c14692c9 filter/AutoConvert: eliminate AutoConvertFilter if possible
If no conversion is necessary, return the child Filter as-is.  This
allows removing all nullptr checks from AutoConvertFilter.
2020-11-04 20:15:19 +01:00
Max Kellermann
226eb26300 filter/ffmpeg: interleave the output AVFrame
If the FFmpeg filter outputs planar data, interleave it, just like the
FFmpeg decoder plugin does.
2020-11-04 20:15:19 +01:00
Max Kellermann
2d606fa989 decoder/ffmpeg: move code to lib/ffmpeg/Interleave.cxx
To be reused by the FFmpeg filter plugin.
2020-11-04 20:15:19 +01:00
Max Kellermann
7a0342c8bb decoder/ffmpeg: use AVFrame fields instead of AVCodecContext fields 2020-11-04 20:06:45 +01:00
Max Kellermann
42c9d765cf lib/ffmpeg/Buffer: add missing include 2020-11-04 20:06:41 +01:00
Max Kellermann
a8a80ee689 lib/ffmpeg/Buffer: disallow copying 2020-11-04 19:51:21 +01:00
Max Kellermann
f9bdb4b0b8 lib/ffmpeg/Buffer: add noexcept 2020-11-04 19:50:38 +01:00
Max Kellermann
9332527872 lib/ffmpeg/{Buffer,Time}: remove obsolete "#undef SampleFormat"
This compatibility macro has been removed from FFmpeg long ago.
2020-11-04 19:50:33 +01:00
Max Kellermann
84f772357e filter/convert: convert_filter_new() returns std::unique_ptr 2020-11-04 16:47:11 +01:00
Max Kellermann
f2b9785a67 filter/chain: pass std::string_view to filter_chain_append() 2020-11-04 16:37:53 +01:00
Max Kellermann
eeaec99c59 filter/LoadChain: use IterableSplitString() 2020-11-04 16:36:11 +01:00
Max Kellermann
b0002e3b73 filter/chain: copy the child name
filter_chain_parse() passes a temporary string pointer which results
in a use-after-free in the PreparedChainFilter::Child::Open() error
message.
2020-11-04 16:34:38 +01:00
Max Kellermann
27c589da97 filter/chain: remove unused field ChainFilter::Child::name 2020-11-04 16:26:50 +01:00
Max Kellermann
92a218b7a9 playlist/registry: add option "as_directory"
This allows users to disable the "CUE files as directories" feature
without having to disable the CUE playlist plugin completely.  This
feature has been annoying some users.
2020-11-04 16:13:12 +01:00
Max Kellermann
bb009daf66 playlist/registry: simplify ExtractMimeTypeMainPart() 2020-11-04 13:34:04 +01:00
Max Kellermann
3d276d50b4 event/PollBackend: use vector::push_back() instead of resize() 2020-10-30 16:35:20 +01:00
Max Kellermann
b1b731340e event/PollBackend: add Item constructor 2020-10-30 16:32:45 +01:00
Max Kellermann
b9b02b4ff2 event/PollBackend: use unordered_map::find() instead of operator[]
The latter creates a new object, but we know that the key already
exists.
2020-10-30 16:25:41 +01:00
Max Kellermann
ab5d23da11 event/PollBackend: use unordered_map::emplace() in Add() 2020-10-30 16:24:32 +01:00
Max Kellermann
0554fe3652 event/PollBackend: use std::size_t 2020-10-30 16:09:29 +01:00
Max Kellermann
b0282fe36f event/PollGroupWinSelect: add Item constructor 2020-10-30 16:07:23 +01:00
Max Kellermann
69b45e693b event/WinSelect: use unordered_map::find() instead of operator[]
The latter creates a new object, but we know that the key already
exists.
2020-10-30 16:05:25 +01:00
Max Kellermann
9e97acc28d event/WinSelect: merge duplicate code into ApplyReady() 2020-10-30 15:55:23 +01:00
Max Kellermann
b1e446a931 event/WinSelect: add missing const to deleted copy ctor/operator 2020-10-30 15:45:29 +01:00
Max Kellermann
938319cd44 event/WinSelect: reorder method prototypes 2020-10-30 15:45:12 +01:00
Max Kellermann
fee29001fa event/WinSelect: use unordered_map::emplace() in Add()
This allow using erase() with iterator, without a key lookup.
2020-10-30 15:32:11 +01:00
Max Kellermann
6d894a1806 event/WinSelect: use SOCKET as std::unordered_map key 2020-10-30 15:25:09 +01:00
Rosen Penev
f1fc5d79ca
clang-tidy: convert to all/any_of
Found with readability-use-anyofallof

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-10-28 15:51:21 -07:00
Max Kellermann
bb99cf37e3 release v0.22.2
-----BEGIN PGP SIGNATURE-----
 
 iQJEBAABCgAuFiEEA5IzWngIOJSkMBxDI26KWMbbRRIFAl+Zm30QHG1heEBtdXNp
 Y3BkLm9yZwAKCRAjbopYxttFEm0BD/0eeuI09j2LPCCQQdOUxl3ydWDLVVqDbT/b
 wUYLFEIscr0Kr8k4Mcl3C5LBEeCJq4ZYQ/VqlgNVC11SXVhq7IHJALJ3rYQVIpx+
 7MGfd1M0G39d9nlEFeKG2iNKx78aiBTqkMC9MtctacIOiKmntXP0cZZxpqGMMVZs
 5t8l8i2CM35BWisu0PjSvPJMzGVf9lgEIqx1ejHBFrX6V6DEZ8d6KEbV9FulNo1Y
 bH1UmKdsz71LC1ZE9EescmL5kVvaXyWyJmDDiu2/sqcMRjAHl2+RIAsunv6SqdGH
 Sk4OZbtXB8M8EQHuSJESUS6SnQEyGdwCptBn4NHXkajzRJqKCq0FRDyQGT+qrmUr
 H+91rZeWRYFbBMStP9l9MMQiTTjXgfCnHExDK9AmrMhiuYnuVxV1deEP7FXswCkd
 yU3sPpcKgdzMEYzoTuzXJVyMIKr0WOmNGFMEUbxfBXZDCbT1i9SH+Bi0kQAYe9h9
 JQTSWeS5NDRcI/b6nHS6ccUGFEp1scbXQNLw+17UvrUwfeZW9N9/t6jPS4kdUNEm
 tnNmbM/3o7yT3B8BGKTl5qBVSjCcgqKfsBXvy9Qn2zE0TN4HQPiJSDXZEH9LuZR1
 c6b8aI94gZkN4av1OAjmZgLyn+Pr2gyrei4FQNXyjNJkV5F3wiiLhhDTEMc2WLNm
 Zf4qpZArww==
 =eRNp
 -----END PGP SIGNATURE-----

Merge tag 'v0.22.2' into master

release v0.22.2
2020-10-28 17:33:10 +01:00
Max Kellermann
7b9295ff99 lib/yajl/Handle: strip newlines from error messages
Closes https://github.com/MusicPlayerDaemon/MPD/issues/981
2020-10-28 16:06:52 +01:00
Max Kellermann
5f61d440eb lib/yajl/Handle: un-inline the throwing code
Reduces header dependencies.
2020-10-28 16:02:14 +01:00
Max Kellermann
6bc73a9ebe util/FormatString: update API documentation 2020-10-28 15:48:42 +01:00
Max Kellermann
1195eb266e protocol/Ack: remove unused variable ack_domain 2020-10-28 15:47:05 +01:00
Max Kellermann
3562a3e51e Main: save the state_file on shutdown
This got lost in commit 5d597a3646 (v0.21.19), but it was never
noticed because the state_file_interval was way too short due to
commit 3413d1bf23, fixed recently by commit 27cc7b352d
2020-10-28 15:29:47 +01:00
Max Kellermann
7c47fe746c event/Loop: AbandonFD() unlinks the SocketEvent
Fixes use-after-free bugs causing assertion failures at shutdown,
because all "abandoned" SocketEvents are still in the linked list.

Closes https://github.com/MusicPlayerDaemon/MPD/issues/986
Closes https://github.com/MusicPlayerDaemon/MPD/issues/987
2020-10-28 15:01:32 +01:00
Max Kellermann
65a1c4a016 event/Loop: pass SocketEvent& to AbandonFD() 2020-10-28 14:59:28 +01:00
Max Kellermann
46418d0f2d event/ServerSocket: remove obsolete API documentation 2020-10-28 14:52:31 +01:00
Max Kellermann
bbfa6fe632 db/simple: purge songs for unavailable decoder plugins on update 2020-10-28 14:36:20 +01:00
Max Kellermann
bf97d13d0b fs/Traits: add GetPathSuffix() 2020-10-28 14:29:46 +01:00
Max Kellermann
b5673b6333 db/simple/Directory: add pure attribute 2020-10-28 14:24:58 +01:00
Max Kellermann
ee802867df db/update/Walk: add code comments 2020-10-28 14:23:39 +01:00
Max Kellermann
ecaa51e322 db/simple: purge special directories for unavailable plugins on update 2020-10-27 19:14:31 +01:00
Max Kellermann
0779333064 db/update/Walk: adjust lamba indent 2020-10-27 19:14:31 +01:00
Max Kellermann
6f1a4a73b7 fs/Traits: add GetFilenameSuffix() 2020-10-27 19:14:31 +01:00
arcnmx
ad585e179f system/FileDescriptor: fix Duplicate result
dup2 returns new_fd on success, not 0
2020-10-20 09:32:43 -07:00
Max Kellermann
8348a1ec8f event/PollGroup: rename to PollBackend 2020-10-19 14:52:59 +02:00
Max Kellermann
c18e00daa4 event/PollGroup: move event flags to a separate header
Reduce header dependencies for SocketEvent.hxx.
2020-10-19 14:48:41 +02:00
Max Kellermann
418ba96334 event/SocketEvent: forbid copying 2020-10-18 20:07:49 +02:00
Max Kellermann
a60e782959 event/Loop: reorder assertions 2020-10-18 20:05:22 +02:00
Max Kellermann
8bab5733d7 event/Loop: add assertions 2020-10-18 20:04:16 +02:00
Max Kellermann
e3270dfd68 event/SocketEvent: use class IntrusiveList<> 2020-10-18 20:02:47 +02:00
Max Kellermann
a14997ffb8 event/Loop: manage all SocketEvents in a linked list
Not only those which are "ready".
2020-10-18 20:01:38 +02:00
Max Kellermann
dd94f97572 event/Loop: un-inline AddFD(), ModifyFD()
Prepare for adding more code here.
2020-10-18 19:58:42 +02:00
Max Kellermann
7d502fb448 event/Loop: round epoll_wait() timeout up
This implements proper rounding, amending commit dcbb9fe07c
2020-10-18 19:58:42 +02:00
Max Kellermann
3ac87bbcda io/uring/Queue: use IntrusiveList<> 2020-10-18 19:37:54 +02:00
Max Kellermann
f64799622d event/IdleEvent: use class IntrusiveList<> 2020-10-18 19:28:12 +02:00
Max Kellermann
6f0ad2b6c5 util/IntrusiveList: replacement for boost::intrusive::list 2020-10-18 19:23:34 +02:00
Max Kellermann
b5750afb24 event/IdleEvent: use auto 2020-10-18 19:23:34 +02:00
Max Kellermann
442dd5e955 event/IdleEvent: forbid copying 2020-10-18 19:23:25 +02:00
Max Kellermann
172c2ae1aa release v0.22.1
-----BEGIN PGP SIGNATURE-----
 
 iQJEBAABCgAuFiEEA5IzWngIOJSkMBxDI26KWMbbRRIFAl+K29wQHG1heEBtdXNp
 Y3BkLm9yZwAKCRAjbopYxttFEh/YEACRSf+EJaSCnqDWICcqMqh5NfUMkZhq6IXA
 36Vk2njYkEiNdePLTkoB/L4fVHiUuTiyeRTUshL6uy2J37fYc9w3tmyTdSStbFP+
 LAH4wVT0PKNVCpit8CVL1lwABG1fmUohejztrf7dIDqUrESwLrTtSbKKYKofQ5hp
 zVgFkV+Kza9fL2FGiw0ySpkhNfOv+eJBhpi8xitnYT8TpYrLqJdMzGW8oP5CFagI
 9Ot5LFRKfhoKmh8TklKI2jlRCziQ3Y/kCvtJcOxE1d8BhXdgUbnF1KRUKxcM+oqP
 jcFZ949zHl4vIqgdZ+dYczUZV74KbMIhqhB1jTApPnTSrpizt2h1+UhB7Jnxo2uC
 CfXf88+I/BPx5UY7wGxDSJnOqTs2RVa64EZPf0pgB/aOdM4tM96HWzZrFF0CilgD
 E897O9eyNzNeESzbXuhZwoO4luGyoiicpzZ6rLiH0fbkhpngBlJmYLup7pDfXe2E
 6jDev0YKtfzXeM0NHHGeZRMcYyMq6swDvfHF7ndpXdUMgOSu6lVSoR+VTe0oPoIB
 zrJV0pge901Q4wByMsoebY8K3eX9W8bqXtuaVMu6ZdYnHeCy79QiZkIDHMGZWDJb
 YBrHd+/zkGgyB6XndmtNSg6Uo7RPKwQEBP/sk5YhJ04KUdYSdPMKG1WXSRy7NfzL
 yaUPBqay2Q==
 =LH6z
 -----END PGP SIGNATURE-----

Merge tag 'v0.22.1' into master

release v0.22.1
2020-10-17 13:58:36 +02:00
Max Kellermann
6a65b4c305 lib/nfs/patches: disable the snprintf->sprintf_s alias
snprintf() is available on mingw, and the libnfs kludge broke the
build with mingw, because sprintf_s() was now both an inline function
and a "dllimport" function (because the macro renamed the inline
function snprintf() to sprintf_s() in mingw's stdio.h).
2020-10-17 13:56:02 +02:00
Max Kellermann
4f0e0af319 Merge branch 'v0.22.x' into master 2020-10-16 19:02:03 +02:00
Max Kellermann
cb382b1e7d event/PollGroupWinSelect: add missing return value
Fixes regression from commit 1473d8474f
2020-10-16 19:02:00 +02:00
Max Kellermann
31268ad7cd decoder/opus: fix track/album ReplayGain fallback
Fixes regression by commit 23d5a2b862 -
that commit always pretended that any Opus file has both track and
album gain, and thus disabled the fallback to the other if one is not
set.

This patch changes the logic to only submit ReplayGain if at least one
value is set, and apply the offset only to that value.  If none is
available, then the new check in HandleAudio() will submit only the
output gain.

Closes https://github.com/MusicPlayerDaemon/MPD/issues/977
2020-10-16 18:45:18 +02:00
Max Kellermann
a0d43dd87f decoder/opus: submit output_gain even if there is no OpusTags packet 2020-10-16 18:41:16 +02:00
Max Kellermann
1db533c8cf decoder/opus: move formula to EbuR128ToReplayGain() 2020-10-16 18:39:29 +02:00
Max Kellermann
78ee663660 decoder/opus: move comment to output_gain field 2020-10-16 18:30:51 +02:00
Max Kellermann
c32a809d38 decoder/opus: convert field output_gain to float 2020-10-16 18:28:57 +02:00
Max Kellermann
871bf3b88f command: add command "getvol"
Closes https://github.com/MusicPlayerDaemon/MPD/issues/979
2020-10-16 17:51:51 +02:00