Commit Graph

12754 Commits

Author SHA1 Message Date
Max Kellermann
364acc8949 lib/curl/Escape: add CurlUnescape() 2019-10-15 13:39:02 +02:00
Max Kellermann
a8f4d2b6fc storage/curl: move code to EscapeUriPath() 2019-10-15 13:24:06 +02:00
Max Kellermann
0eb113e7c6 lib/curl/String: OO wrapper for allocated strings returned from CURL 2019-10-15 13:13:39 +02:00
Max Kellermann
b2c4a5db14 util/UTF8: use uint8_t instead of unsigned char 2019-10-14 13:44:11 +02:00
Max Kellermann
cadfccfd0c util/UTF8: add noexcept 2019-10-14 13:41:06 +02:00
Max Kellermann
c89c7f71a2 thread/Util: lower the real-time priority from 50 to 40
On linux-rt, kernel IRQ threads are configured with priority=50, and
this change configures MPD somewhat below that priority, leaving some
room for other programs to be configured in between.

Closes https://github.com/MusicPlayerDaemon/MPD/issues/643
2019-10-09 14:40:02 +02:00
Andre Heider
96a9670c69 lib/icu: fix build with iconv() 2019-10-07 13:34:04 +02:00
Max Kellermann
dcc5ce6792 storage/curl: request the "resourcetype" property to fix update
Without requesting the property, "good" WebDAV servers would not send
it, and so MPD could never recognize a directory, failing the database
update.

Closes https://github.com/MusicPlayerDaemon/MPD/issues/660
2019-10-07 12:44:48 +02:00
Max Kellermann
23d08820a2 db/update/Walk: fix crash when music_directory is not a directory
Add a runtime sanity check to avoid the assertion failure.

Closes https://github.com/MusicPlayerDaemon/MPD/issues/660
2019-10-07 12:24:25 +02:00
Max Kellermann
2f3e94f8d0 output/MultipleOutputs: add method IsOpen() 2019-09-26 14:52:19 +02:00
Max Kellermann
f616bfe354 output/MultipleOutputs: add method HasName() 2019-09-26 14:48:31 +02:00
Max Kellermann
f2c3d86612 output: use StringIsEqual() 2019-09-26 14:48:31 +02:00
Max Kellermann
d7dbf47a3f time/ISO8601: support omitting minutes 2019-09-25 21:39:25 +02:00
Max Kellermann
3db584a3ea curl/Easy: add SetReadFunction() 2019-09-25 21:37:42 +02:00
Max Kellermann
409002b1c3 curl/Easy: add Perform() 2019-09-25 21:37:22 +02:00
Max Kellermann
29b542fd36 curl/Easy: add SetTimeout() 2019-09-25 21:36:52 +02:00
Max Kellermann
c9590db188 util/StringView: enable string_view support only on C++17 2019-09-25 21:34:48 +02:00
Max Kellermann
0643b5abad release v0.21.15
-----BEGIN PGP SIGNATURE-----
 
 iQJEBAABCgAuFiEEA5IzWngIOJSkMBxDI26KWMbbRRIFAl2LvuAQHG1heEBtdXNp
 Y3BkLm9yZwAKCRAjbopYxttFEg3VD/9uWiK11PPXfpAqOQgL63c1CS/6HJizwnox
 n0ns3T7eJJPXy06NTwuo5M8JeAIhuysEciHlJeGBf4NIGwGGHOL3nQv3FkWJlfeh
 UrIJq66gIzElZ62Jvq+7zkkfjm6A0tmQoAEoIPouus+A4RNwndpqsKSotZzLK0yY
 ACkJTxl8JJj+UbLzleDKSA+RxG817onGKl+urkvNDRdD7xs3VEUX6jhddVM1n3m+
 BqCaihuQZYXur45mYIwFI7H5JevRawnEX8L6tERW0cE8j5IhnnPjwYvMX+DcZoTe
 DgYuGkfPTfl31QufbbetTwWITjf4nrummYrAM/fKcNJcaqZFo4hs7m7N6p9c2ebm
 QCUG0On32Lvkq4/iLAxXIdoy38mPkarREB2XQebHa6j2XPFjxB01lXLGYJzPtqBu
 LCFRpR+ssWeZDQ3uP+fAzlgMXmB+owWa9NVqU5vlx97TCmXInOeim6tfq1T4keGW
 3VFLqM6VAw4QyhrbowU0xbvxvYkWrgpkYbM5NcfwI67xZGLsI5vnRzX05VgF6BFZ
 B7g+JIWjv+Mjm1ltsvC4OlJEcCXZb0BQWvwLHq0EGeEP/R9MWYX6BxlF1V8FWR2S
 bIL0qIqtZfuUI66irNn23ZCyN4DilMcZkS8f30321hB2GLputG8zZwCcjxy1a/ft
 1OoHXRfKNw==
 =uONC
 -----END PGP SIGNATURE-----

Merge tag 'v0.21.15'

release v0.21.15
2019-09-25 21:27:31 +02:00
Max Kellermann
92495d2b0b decoder/mpcdec: fix bogus ReplayGain values
Apparently, libmpcdec sets gain/peak variables to zero if they are not
present.  This clashes with our formula and results in bogus values
which cause noise during playback.

Closes https://github.com/MusicPlayerDaemon/MPD/issues/640
2019-09-13 19:52:11 +02:00
Max Kellermann
9270829b5b ReplayGainInfo: move more code to a function 2019-09-13 19:50:49 +02:00
Max Kellermann
b6243a9945 decoder/mpcdec: merge duplicate code 2019-09-13 19:50:43 +02:00
Max Kellermann
496f88653d ReplayGainInfo: add static method Undefined() 2019-09-13 19:46:39 +02:00
Max Kellermann
bf49c9e4e2 decoder/{dsf,dsdiff}: precalculate bit rate 2019-09-08 12:52:02 +02:00
Max Kellermann
0da9c91af2 decoder/{dsf,dsdiff}: fix displayed bit rate
The formula did not consider the channel count.

Closes https://github.com/MusicPlayerDaemon/MPD/issues/639
2019-09-08 12:45:05 +02:00
Max Kellermann
d63e2c2641 db/update: scan CUE playlist contents
This commit adds a PlaylistPlugin attribute "as_folder" which for now
is only enabled in the "CUE" playlist plugin (which handles separate
"*.cue" files).  If a playlist with this flag set is being scanned
during database update, it will be parsed and its contents will be
added to the database.  This allows clients to inspect them like
directories and its contents will be searchable.

Closes https://github.com/MusicPlayerDaemon/MPD/issues/39
2019-09-08 00:39:53 +02:00
Max Kellermann
5fdb804a50 db/simple/Song: add attribute "target"
Will be used for Song objects representing tracks inside a CUE file.
2019-09-08 00:32:16 +02:00
Max Kellermann
91c1274ac6 db/Song: translate relative "real_uri" paths 2019-09-08 00:31:10 +02:00
Max Kellermann
9caf90f74f util/UriRelative: add uri_apply_relative() 2019-09-08 00:07:37 +02:00
Max Kellermann
71448e645c util/UriExtract: use uri_get_scheme() in uri_has_scheme() 2019-09-08 00:06:52 +02:00
Max Kellermann
0509472636 util/UriExtract: add uri_is_relative_path() 2019-09-08 00:04:49 +02:00
Max Kellermann
0b956cf968 util/StringAPI: add memrchr() wrapper 2019-09-07 23:59:59 +02:00
Max Kellermann
58363cf4dd util/UriRelative: allow "parent" to end with slash 2019-09-07 23:27:24 +02:00
Max Kellermann
2574615fa3 util/UriRelative: use StringAfterPrefix() instead of memcmp()
memcmp() can overrun the buffer.
2019-09-07 23:24:41 +02:00
Max Kellermann
15fbd2b4ab util/UriRelative: use StringIsEqual() 2019-09-07 23:22:16 +02:00
Max Kellermann
ee36a48dbb db/simple/Directory: RemoveSong() returns SongPtr 2019-09-05 21:12:10 +02:00
Max Kellermann
07f212c98c SongSave: return DetachedSong, not a std::unique_ptr<>
Eliminate unnecessary dynamic allocations.
2019-09-05 20:58:04 +02:00
Max Kellermann
a1e2602c3d SongSave: allow throwing any exception 2019-09-05 20:58:00 +02:00
Max Kellermann
b03e4ae692 queue/Save: move code to LoadQueueSong() 2019-09-05 20:56:47 +02:00
Max Kellermann
57808d1a1b queue/Save: queue_load_song() throws on error
Don't catch and log exceptions here; let the caller decide.
2019-09-05 20:55:18 +02:00
Max Kellermann
7775691965 db/simple/Song: rename "uri" to "filename"
This attribute is not a URI; it is just the filename without its
parent directory path.  To avoid confusion, let's rename it to
"filename", leaving the struct without a "uri" attribute.
2019-09-04 12:04:35 +02:00
Max Kellermann
a727150c8d db/simple/Song: remove StringView constructor 2019-09-04 12:03:56 +02:00
Max Kellermann
949916cba1 db/simple/Song: convert NewFrom() to constructor 2019-09-04 12:03:49 +02:00
Max Kellermann
497d090814 db/simple/Song: remove static method NewFile() 2019-09-04 12:03:41 +02:00
Max Kellermann
6a13847287 db/simple/Song: add template constructor 2019-09-04 12:03:37 +02:00
Max Kellermann
cbe7d052e8 db/simple/Song: use PathTraitsUTF8::Build() 2019-09-04 12:02:18 +02:00
Max Kellermann
f4d0bd8205 db/simple/Song: make "parent" a reference, not a pointer 2019-09-04 12:02:17 +02:00
Max Kellermann
1bfede120a fs/Traits: call std::string::reserve() in BuildPathImpl() 2019-09-04 12:01:25 +02:00
Max Kellermann
e96856032f SongSave: use StringIsEqual() 2019-09-04 11:13:39 +02:00
Max Kellermann
05a29e8458 db/simple/Song: simplify Export() 2019-09-03 20:36:39 +02:00
Max Kellermann
7f9a8b8748 db/simple/Song: convert "uri" to a std::string
No longer allocate it as a "VarSize".  This used to be a clever trick
to save memory 10 years ago, but these days, keeping the code
maintainable seems more important than saving a few kilobytes of
memory.
2019-09-03 20:26:47 +02:00
Max Kellermann
af3f637d3f db/simple/Song: pass StringView to constructor 2019-09-03 20:25:04 +02:00
Max Kellermann
97a9adcbec db/update/Archive: convert pointer to reference 2019-09-03 19:54:18 +02:00
Max Kellermann
177d3b0178 db/update/Archive: use MakeDirectoryIfModified() 2019-09-03 19:52:15 +02:00
Max Kellermann
12beb22c1d db/update/VirtualDirectory: add LockMakeVirtualDirectoryIfModified() 2019-09-03 19:51:20 +02:00
Max Kellermann
29fd3172ee db/update/VirtualDirectory: pass device_id to MakeVirtualDirectoryIfModified() 2019-09-03 19:49:32 +02:00
Max Kellermann
a873137702 db/update/VirtualDirectory: rename MakeDirectoryIfModified() 2019-09-03 19:49:10 +02:00
Max Kellermann
e08298a66f db/update/Container: move MakeDirectoryIfModified() to VirtualDirectory.cxx 2019-09-03 19:37:53 +02:00
Max Kellermann
fd1826cb91 db/update/Container: move SupportsContainerSuffix() to struct DecoderPlugin 2019-09-03 19:36:56 +02:00
Max Kellermann
d5681b678c db/update/Walk: move UpdatePlaylistFile() to Playlist.cxx 2019-09-03 18:53:33 +02:00
Max Kellermann
0fd6235a66 playlist/Registry: add FindPlaylistPluginBySuffix() 2019-09-02 20:28:14 +02:00
Max Kellermann
4d11745156 playlist/Plugin: add SupportsSuffix(), SupportsMimeType() 2019-09-02 20:19:47 +02:00
Max Kellermann
2038620bc4 db/simple/Directory: add method IsReallyAFile() 2019-09-02 20:15:52 +02:00
Max Kellermann
5dc7cb87bb db/simple/DirectorySave: use StringIsEqual() 2019-09-02 20:10:26 +02:00
Max Kellermann
f885e068c8 playlist/Plugin: add constructors 2019-09-01 15:01:58 +02:00
Max Kellermann
0d16772dea playlist/Plugin: rename with CamelCase 2019-09-01 14:58:49 +02:00
Max Kellermann
2376527d1f db/DatabaseSong: add noexcept 2019-09-01 14:56:27 +02:00
Max Kellermann
7f043367ed db/UniqueTags: add API documentation 2019-09-01 14:55:25 +02:00
Max Kellermann
45403b44de db/update/ExcludeList: add noexcept 2019-09-01 14:02:34 +02:00
Max Kellermann
32f865f146 db/update/InotifySource: add noexcept 2019-09-01 13:58:45 +02:00
Max Kellermann
9f92b59376 db/update/InotifyQueue: add noexcept 2019-09-01 13:58:22 +02:00
Max Kellermann
2bb5030f70 db/update/Queue: add noexcept 2019-09-01 13:55:17 +02:00
Max Kellermann
366de8773c db/update/Service: add noexcept 2019-09-01 13:51:34 +02:00
Max Kellermann
d3cc54d4eb TagArchive, db/update/Service: catch all exceptions 2019-09-01 12:57:24 +02:00
Max Kellermann
71ef0faa2c output/Source: move code to DropCurrentChunk() 2019-08-27 19:07:52 +02:00
Max Kellermann
328a6de86e output/Source: document "pending_tag" ownership 2019-08-27 19:07:52 +02:00
Max Kellermann
4c7154bd23 filter/Observer: add noexcept 2019-08-26 21:04:35 +02:00
Max Kellermann
4f5c3b349d filter/Filter: document that Flush() can throw 2019-08-26 21:03:25 +02:00
Max Kellermann
4fabfdabde filter/Filter: allow throwing any exception 2019-08-26 21:01:22 +02:00
Max Kellermann
2e9b5e4e78 filter/Registry: rename the source file 2019-08-26 20:54:52 +02:00
Max Kellermann
115dd2b5ce lib/curl: require CURL 7.33, remove bug workaround 2019-08-26 20:43:39 +02:00
Max Kellermann
b18003ddfd lib/curl/Global: add missing include 2019-08-26 20:40:26 +02:00
Max Kellermann
6ec335dcd5 net/UniqueSocketDescriptor: import std::swap() 2019-08-26 20:37:47 +02:00
Max Kellermann
d5d6746ddf net/UniqueSocketDescriptor: update copyright year 2019-08-26 20:37:31 +02:00
Max Kellermann
00d7759cee net/SocketDescriptor: expose CheckDuplicate() 2019-08-26 20:36:51 +02:00
Max Kellermann
2ecc4e3eed net/AllocatedSocketAddress: remove config.h, we have Features.hxx already 2019-08-26 20:28:53 +02:00
Max Kellermann
7d98145ea8 net/AddressInfo: include Features.hxx instead of config.h 2019-08-26 20:26:40 +02:00
Max Kellermann
e7c5a59e39 util/Exception: support "const char *" 2019-08-26 20:24:22 +02:00
Max Kellermann
c9081a206a client/New: fix assertion failure in Close()
Caused by a revert accident in commit
f2cdbeace6

Closes https://github.com/MusicPlayerDaemon/MPD/issues/631
2019-08-22 14:43:53 +02:00
Max Kellermann
818b7e0641 output/solaris: include sys/stropts.h only on Solaris
This header had been available for a long time on Linux, but was
removed in glibc 2.30.  This commit moves the `#include` line inside
the `#ifdef __sun` block and adds a fake declaration of `I_FLUSH` for
the Linux build.

Closes https://github.com/MusicPlayerDaemon/MPD/issues/630
2019-08-22 11:41:12 +02:00
Max Kellermann
f2cdbeace6 Revert "Client: eliminate SetExpired(), call Close() directly"
This reverts commit 58d7804d66.  It
caused a use-after-free bug when Client::OnSocketError() was called
due to a failed write, e.g. if the output buffer was full.
2019-08-22 09:52:19 +02:00
Max Kellermann
e6600b8562 release v0.21.14
-----BEGIN PGP SIGNATURE-----
 
 iQJEBAABCgAuFiEEA5IzWngIOJSkMBxDI26KWMbbRRIFAl1dBToQHG1heEBtdXNp
 Y3BkLm9yZwAKCRAjbopYxttFEhlID/4gcrbaegKpTkftGPLBGlSUc4W0qwSHbdiJ
 SuzK7sraSGUlLHHiBfqvFfE8tyEaLfsJarqiOdGgfiaW5QyapdwuU5s76nAN6jjY
 onEo2QK6vSbv4J/B1+Jv+NGCgVM3ZkPy91GhfTz8MEtJMaBmztFhnpxK60r9jYPG
 5EBsnVa6HhI7gniQAtOwE8SXYnn92Q4j72S8OuAbJ7Vwh0oqdIyXECqzcAE97Fk2
 TNX/YSLST3I7Chv2OBDb3vOegh9nFUyr0qeSYdi8vk2BBYcgX2xYOOBQCC3ta/nr
 NNeuSJOLgcF1XrFqVRRhDKZ8Y2inD6qVAXOH5WtChT1n3uXqYW7vdq0fW+/w3W/E
 vouzgt5KvU5Me4Mk2M2dMjEWW+7Y8EUjvrwDnbDIkyP+Yi+BLTmTnyBgAW3cvRO9
 UoCcWTBOEgyX2wAFl3r+NMPEneuMLbMCZUMju4/zveiRJdFExA0LC8wk0/iWqQbW
 +WD8y6RTo7Z1jsP1vnBimgAkzkLAOuMlKLYNI15ETrxwKWgOjN6a7Q61GVdsaiqG
 fKQeO0kZWWFcJ7HECgp3tpwWEi1+7/uqt0TwQgOKDdZHYL0Wb6Ur09KJS4b+eKIl
 UzYwCrPgUx1pcYR+rTbMxCNpWn2kA+vp2UaPBN60c/J98d+6C/2nKtIvXfr5MrUA
 CEb1epw/ew==
 =mEFF
 -----END PGP SIGNATURE-----

Merge tag 'v0.21.14'

release v0.21.14
2019-08-21 10:52:49 +02:00
Max Kellermann
b968e1b6de output/Thread: add missing return in exception handler 2019-08-21 10:20:17 +02:00
Max Kellermann
6c9f9c136b command/all: don't create new Response instance in exception handler
The new Response instance in the `catch` block didn't have the
`command` attribute set, so the error response didn't indicate which
command had failed, which however is required in the MPD protocol.

Closes https://github.com/MusicPlayerDaemon/MPD/issues/628
2019-08-20 20:31:36 +02:00
Max Kellermann
9bff5f9e36 client/Process, command/all: add noexcept
Clarify that those can't throw, preparing for the next commit.
2019-08-20 20:28:15 +02:00
Max Kellermann
2bf26a2ff8 command/all: remove obsolete prototype 2019-08-20 20:28:10 +02:00
Max Kellermann
e33b50d9c5 command/all: simplify return from command_process() 2019-08-20 20:26:07 +02:00
Max Kellermann
21fa44c0d5 command/all: catch all exceptions 2019-08-20 20:23:54 +02:00
Max Kellermann
44444e1b89 decoder/Thread: on late SEEK, start decoder at seek position
Previously, a bogus value (whatever happened to be still in
`start_time`) was used.
2019-08-20 20:15:08 +02:00
Max Kellermann
ca450663d0 decoder/Control: work around crash after SEEK was too late
See code comment.

Closes https://github.com/MusicPlayerDaemon/MPD/issues/629
2019-08-20 20:01:53 +02:00
Max Kellermann
04e2d08417 decoder/Control: inline WaitForDecoder() 2019-08-20 19:33:15 +02:00
Max Kellermann
af4ffa91fd decoder/Control: remove attribute client_is_waiting
This optimization is useless because sane pthread_cond_signal()
implementations check the number of waiters and do not invoke a system
call if there are none.
2019-08-20 19:23:44 +02:00
Max Kellermann
f3ed2c0a82 time/ISO8601: support omitting seconds 2019-08-19 22:44:41 +02:00
Max Kellermann
2c35ea92bd time/ISO8601: support time zone offset 2019-08-19 22:44:28 +02:00
Max Kellermann
26e0e1d25a time/ISO8601: allow omitting the "Z" suffix
And allow "Z" suffix after date.
2019-08-19 22:42:39 +02:00
Max Kellermann
6412efb6e4 time/ISO8601: allow omitting the time of day 2019-08-19 22:42:06 +02:00
Max Kellermann
1a08bdf16f time/ISO8601: ParseISO8601() returns precision 2019-08-19 22:41:49 +02:00
Max Kellermann
48b122f2ed time/ISO8601: implement with strptime(), without ParseTimePoint()
Prepare for adding more flexible parsing.
2019-08-19 22:26:43 +02:00
Max Kellermann
06dac4783f time/Convert: fallback TimeGm() implementation
Move code from Parser.cxx.
2019-08-19 22:22:07 +02:00
Max Kellermann
fdaadc19cb time/Parser: use TimeGm() 2019-08-19 22:21:22 +02:00
Max Kellermann
2e53e9248a time/Parser: explicitly initialize struct tm before strptime()
This is recommended by the strptime() manpage, because strptime() does
not initialize/set attributes which were not specified in the format
string.
2019-08-19 22:09:38 +02:00
Max Kellermann
b7abd5691c lib/curl/Global: use auto 2019-08-19 22:00:25 +02:00
Max Kellermann
7a0957d713 lib/curl/Global: document ToRequest() 2019-08-19 22:00:06 +02:00
Max Kellermann
2934fc2507 lib/curl/Global: remove CURL* parameter from Add() and Remove() 2019-08-19 21:53:19 +02:00
Max Kellermann
0c8ff56a15 lib/curl/Easy: add constructor with URL parameter 2019-08-19 21:48:07 +02:00
Max Kellermann
07be44a50a lib/curl/Easy: add getter functions 2019-08-19 21:47:11 +02:00
Max Kellermann
7a473729af lib/curl/Easy: add method Unpause() 2019-08-19 21:46:21 +02:00
Max Kellermann
402f429b17 lib/curl/Easy: add setter functions 2019-08-19 21:38:55 +02:00
Max Kellermann
4c46ca6b59 lib/curl/Global: make ReadInfo() private 2019-08-19 21:38:09 +02:00
Max Kellermann
76a0bf68c7 lib/curl/Global: remove redundant API docs 2019-08-19 21:38:03 +02:00
Max Kellermann
9f02beaba9 lib/curl: fix coding style 2019-08-19 21:37:47 +02:00
Max Kellermann
a478af6759 util/PrintException, ...: update copyright 2019-08-19 19:11:59 +02:00
Max Kellermann
4c2434788f system/FileDescriptor: add method IsRegularFile() 2019-08-19 19:11:53 +02:00
Max Kellermann
ca9daf5e19 playlist/flac: set song URI to an empty string
Simplify the plugin by using a trivial relative URI; later,
playlist_check_translate_song() will set the correct full URI.
2019-08-16 14:55:12 +02:00
Max Kellermann
e98ce710b8 util/WStringAPI: add wcsncmp() wrapper 2019-08-16 14:48:54 +02:00
Max Kellermann
79d1004544 util/StringView: add method Compare() 2019-08-16 13:32:00 +02:00
Max Kellermann
bb7f7bd3e5 util/StringAPI: add strncmp() wrapper 2019-08-16 13:31:58 +02:00
Max Kellermann
ad2b858933 util/ForeignFifoBuffer: add friend function swap() 2019-08-16 13:27:22 +02:00
Max Kellermann
d7aa4fa7d3 util/ForeignFifoBuffer: make Swap() lower case 2019-08-16 13:27:22 +02:00
Max Kellermann
57c5603122 util/ForeignFifoBuffer: import std::swap() 2019-08-16 13:27:22 +02:00
Max Kellermann
1550113506 util/DynamicFifoBuffer: add nullptr constructor overload 2019-08-16 13:21:28 +02:00
Max Kellermann
a82d61a5e4 util/DynamicFifoBuffer: add API documentation 2019-08-16 13:21:11 +02:00
Max Kellermann
0c4a7c8004 util/AllocatedString: update copyright 2019-08-16 13:20:23 +02:00
Max Kellermann
674ee9d19a util/Exception: forward the exception in ThrowException()
Fixes -Wreturn-std-move (clang 8).
2019-08-16 13:19:34 +02:00
Max Kellermann
3344953db8 util/*FifoBuffer: use using instead of typedef 2019-08-16 13:16:45 +02:00
Max Kellermann
f909615b14 include cleanups (powered by iwyu) 2019-08-15 17:57:20 +02:00
Max Kellermann
92c89f0c86 playlist/flac: allow reading from FLAC streams 2019-08-15 11:13:39 +02:00
Max Kellermann
34246eb7fd playlist/flac: read the file only once using FLAC__Metadata_Chain 2019-08-15 10:40:48 +02:00
Max Kellermann
5894514ccb playlist/flac: move code to ToSongEnumerator() 2019-08-15 10:40:37 +02:00
Max Kellermann
dcb07e6ed4 playlist/flac: use class MemorySongEnumerator 2019-08-15 09:45:03 +02:00
Max Kellermann
ccffff9870 playlist/flac: use the NarrowPath for FLAC__metadata_get_streaminfo() 2019-08-15 09:44:20 +02:00
Max Kellermann
e34672c9d8 lib/xiph/FlacMetadataIterator: add noexcept 2019-08-14 20:14:26 +02:00
Max Kellermann
a8f314190f playlist/flac: add noexcept 2019-08-14 20:08:55 +02:00
Max Kellermann
545af857ba lib/xiph/{FlacStreamMetadata,VorbisComments}: merge redundant code 2019-08-14 19:57:12 +02:00
Max Kellermann
01f86e1c25 lib/xiph/FlacStreamMetadata: pass StringView to flac_scan_comment() 2019-08-14 19:54:19 +02:00
Max Kellermann
7a89b1656c lib/xiph/FlacStreamMetadata: properly convert entries to StringView 2019-08-14 19:44:14 +02:00
Max Kellermann
07fcf091a2 tag/MixRamp: pass StringView to ParseMixRampVorbis() 2019-08-14 19:42:48 +02:00
Max Kellermann
74a883dbf8 tag/MixRamp: add noexcept 2019-08-14 19:42:28 +02:00
Max Kellermann
5c550e8b33 lib/crypto/MD5: add option to use libavutil instead of libgcrypt 2019-08-14 18:56:10 +02:00
Max Kellermann
433e18b247 decoder/{opus,vorbis}: support embedded pictures (METADATA_BLOCK_PICTURE)
More for https://github.com/MusicPlayerDaemon/MPD/issues/42
2019-08-14 12:39:03 +02:00
Max Kellermann
2b837277c1 lib/crypto: add base64 wrapper using libavutil 2019-08-14 12:39:03 +02:00
Max Kellermann
d515a8e99a lib/gcrypt/MD5: add wrapper in lib/crypto/
Prepare for using other crypto libraries, e.g. FFmpeg's libavutil.
2019-08-14 12:39:03 +02:00
Max Kellermann
2c2efaa91f lib/xiph/VorbisComments: pass struct vorbis_comment instead of char**
Use the "comments" attribute instead of relying on the nullptr
terminator.
2019-08-14 12:28:52 +02:00
Max Kellermann
9ae9b2c18f tag/VorbisComment: use struct StringView 2019-08-14 12:22:52 +02:00
Max Kellermann
8e0d810968 tag/MixRamp: use StringView in ParseMixRampTagTemplate() 2019-08-14 12:18:49 +02:00
Max Kellermann
0f1e13d9ff util/StringView: add StartsWithIgnoreCase(), EndsWithIgnoreCase() 2019-08-14 11:36:21 +02:00
Max Kellermann
21b81dfb1d lib/gcrypt/Hash: use the "algo" parameter instead of hard-coding MD5 2019-08-13 20:02:08 +02:00
Max Kellermann
f3d16f6d1b output/Thread: fix typo in comment 2019-08-13 13:08:40 +02:00
Max Kellermann
6b51429203 decoder/opus: move comment size check to ScanOneOpusTag()
Prepare for parsing large binary comments (such as
METADATA_BLOCK_PICTURE).
2019-08-13 12:19:31 +02:00
Max Kellermann
e2da13b0d3 command/file: add command "readpicture"
Closes https://github.com/MusicPlayerDaemon/MPD/issues/42
2019-08-13 11:55:51 +02:00
Max Kellermann
54daa85ac2 decoder/flac: support embedded pictures (FLAC__METADATA_TYPE_PICTURE) 2019-08-13 11:55:51 +02:00
Max Kellermann
575ba51931 tag/Id3Scan: support embedded pictures (the "APIC" tag) 2019-08-12 20:31:43 +02:00
Max Kellermann
96a1c69c29 tag/Handler: add virtual method OnPicture()
Preparing for https://github.com/MusicPlayerDaemon/MPD/issues/42
2019-08-12 20:31:43 +02:00
Max Kellermann
3895d35a52 command/file: move code to TagScanAny() 2019-08-12 20:31:43 +02:00
Max Kellermann
4f61cd0b93 client/Response: add constant MAX_BINARY_SIZE
Use the same chunk size for all binary commands.
2019-08-12 20:23:46 +02:00
Max Kellermann
989790e7f1 client/Response: add method WriteBinary()
Move code from read_stream_art().
2019-08-12 14:17:35 +02:00
Max Kellermann
831bc711ca decoder/mad: remove option "gapless", always do gapless
Why would anybody want to keep the silence inserted by the codec?
Other plugins/codecs (such as Vorbis) have this hard-coded as well.
2019-08-12 13:05:57 +02:00
Max Kellermann
828c614d57 decoder/sidplay: use StringFormat<>() 2019-08-10 12:31:31 +02:00
Max Kellermann
4964ad7800 decoder/sidplay: sidplay_load_songlength_db() throws on error 2019-08-10 12:28:53 +02:00
Max Kellermann
a7976cd0f2 decoder/sidplay: automatic memory management inside struct SidplayGlobal 2019-08-10 12:26:10 +02:00
Max Kellermann
bed8a0e040 decoder/sidplay: move global variables to struct SidplayGlobal 2019-08-10 12:16:09 +02:00
Max Kellermann
b8a64771c0 decoder/sidplay: add noexcept 2019-08-10 12:12:52 +02:00
Max Kellermann
f357f743a3 pcm/Volume: use transform_n() 2019-08-10 12:05:37 +02:00
Max Kellermann
91e565d92e pcm/PcmFormat: use transform_n() 2019-08-10 12:05:35 +02:00
Max Kellermann
a189a9e478 util/TransformN: new library 2019-08-10 11:59:47 +02:00
Fredrik Noring
9654a33218 decoder/sidplay: Fix empty album names by using the SID name field
SID files are generally collections of tunes, so a SID name field makes
sense as an MPD album. The SID tune information list (STIL) has name
and title fields for individual tunes, when such are known, but MPD is
currently not using the STIL.
2019-08-10 11:01:15 +02:00
Max Kellermann
9bcd02d178 Merge branch 'v0.21.x' 2019-08-10 10:58:32 +02:00
Fredrik Noring
2d61e526de decoder/sidplay: Fix date field to have year but not company or author
Field 2 is called <released>, formerly used as <copyright>[1][2]. It is
formatted <year><space><company or author or group>, where <year> may be
<YYYY>, <YYY?>, <YY??> or <YYYY-YY>, for example "1987", "199?", "19??"
or "1985-87". The <company or author or group> may be for example Rob
Hubbard. A full field may be for example "1987 Rob Hubbard".

This change splits the <released> field at the first <space>, to retain
the <year> part.

The 51823 SID files in High Voltage SID Collection (HVSC) version 71
have the following distribution of dates:

    333 19??         11 1990-92       6 1995-99       2 2006-08
    827 198?         88 1990-93    2140 1996        530 2007
     32 1982         69 1990-94       9 1996-97      15 2007-08
      1 1982-83      49 1990-95       2 1996-98       2 2007-09
    255 1983       3467 1991          5 1996-99       1 2007-10
    677 1984         75 1991-92    1840 1997        430 2008
    775 1985         65 1991-93       4 1997-98      23 2008-09
      3 1985-86      10 1991-94    1276 1998          1 2008-12
     10 1985-87      35 1991-97       4 1998-99     631 2009
    943 1986       3320 1992        865 1999          1 2009-10
     12 1986-87      26 1992-93      24 200?        645 2010
      5 1986-89      59 1992-94     590 2000          1 2010-12
   2083 1987          1 1992-96       4 2000-01     538 2011
     31 1987-88    2996 1993        727 2001          1 2011-12
     44 1987-89      42 1993-94     875 2002        651 2012
   2510 1988         12 1993-95       2 2002-04     811 2013
    129 1988-89       2 1993-97     844 2003        790 2014
     91 1988-90    2737 1994          3 2003-05     740 2015
     58 1988-91      16 1994-95     842 2004        792 2016
   3466 1989         20 1994-96       2 2004-05     775 2017
     95 1989-90      17 1994-97     707 2005        638 2018
    150 1989-91    2271 1995          1 2005-06     284 2019
   1077 199?          2 1995-96       2 2005-07
   2834 1990          4 1995-97     785 2006
    119 1990-91       2 1995-98       6 2006-07

References:

[1] https://www.hvsc.c64.org/download/C64Music/DOCUMENTS/SID_file_format.txt
[2] https://hvsc.c64.org/info
2019-08-10 10:50:51 +02:00
Fredrik Noring
7723c481db decoder/sidplay: Fix windows-1252 to utf-8 string conversion
High Voltage SID Collection (HVSC) metadata fields are encoded in
windows-1252, as described in DOCUMENTS/SID_file_format.txt:

https://www.hvsc.c64.org/download/C64Music/DOCUMENTS/SID_file_format.txt

If utf-8 transcoding fails, or the ICU library is unavailable, fall
back to plain ASCII and replace other characters with '?'.
2019-08-10 10:45:02 +02:00
Max Kellermann
cf9ee33928 input/icy: support "charset" parameter in URI fragment
Closes https://github.com/MusicPlayerDaemon/MPD/issues/616
2019-08-10 10:07:13 +02:00
Max Kellermann
4a47bbd816 IcyMetadataParser: implement charset conversion 2019-08-10 10:07:13 +02:00
Max Kellermann
7654038d65 util/UriQueryParser: new library 2019-08-09 20:39:34 +02:00
Max Kellermann
e4612ecb66 util/UriExtract: add uri_get_fragment() 2019-08-09 20:39:23 +02:00
Max Kellermann
9c6850210d util/UriExtract: uri_get_scheme() returns StringView
Reduce overhead by not duplicating the string.
2019-08-09 20:21:37 +02:00
Max Kellermann
40a2880857 util/UriUtil: split 2019-08-09 20:21:12 +02:00
Max Kellermann
ade712d711 util/UriUtil: relicense as BSD-2 2019-08-09 20:16:02 +02:00
Fredrik Noring
0ed10542cc decoder/sidplay: Fix song length initialisation during container scan
The song length was previously undetermined.
2019-08-09 15:39:36 +02:00
Max Kellermann
349a2ea7eb Merge branch 'sid-genre-option' of git://github.com/frno7/MPD 2019-08-09 14:45:41 +02:00
Max Kellermann
192ad91010 release v0.21.13
-----BEGIN PGP SIGNATURE-----
 
 iQJEBAABCgAuFiEEA5IzWngIOJSkMBxDI26KWMbbRRIFAl1JSe4QHG1heEBtdXNp
 Y3BkLm9yZwAKCRAjbopYxttFEq5gEACNRnk8lADXzerHiuhyySJTpo1hweh+tRpx
 fEahsC1SWa5677SsvHtk+Er8HTrpr0mSCefBbfqAKBSsJzdm1TUepCbEZrKM3jF5
 0PaRiKlOQraqLnT95AOVbdzKK0N2aKvf3aJfDkquG93YfMyJJr0oTGFfQNTT4VFC
 +HuvcqlMragXfLD2xp9WxhjYTajDmCobeBlHKND7FD67VyQqWIwWsRMKZKXXeplS
 kQlFSNLfb4L6x7Qvnz57wMSYHQ1yzjZKoEczjR5WEJBz4GYsw+8BB6M5TR+cyo+y
 LjiEMYMk1b+YiIneuloRaeCS/5PxMBeCSC+w6uqfnm9wGA5dv6zAWwHWJ6XqIYTv
 ORAxoWJ1oN3HAv7ao57g2kGJ5WZwrfVyiS0hViPM0D181w6dMvPgmWdltPZphxtY
 3uNurG45lecXoTtuv4EqWeeVOBzoJI1dUyQ7e73a9+Cpl9u7suAoe/nm3F/nh5ti
 l+I5VeK82GVBePXn02ZRAhkZ+Ll3jvt5Bpz/wyNutP6pWtFjYS6p1W19Hi2UiNOv
 56+ackJFr4oCqOoCKWHbwJbyrx44nhnBxiyEOhGdVA9xdB2EpYKOoZ29iGKEO2um
 +QytEt8gf6YVe3C51OlmJfnZoJ4+pwIWpQFyjT40CMy6ZL0swdLlMgFv5+LSjzrC
 eKJz2/h4dg==
 =ICvW
 -----END PGP SIGNATURE-----

Merge tag 'v0.21.13'

release v0.21.13
2019-08-06 11:39:25 +02:00
Max Kellermann
bcccc8f66c output/jack: use jack_free() for Windows compatibility 2019-08-06 11:34:56 +02:00
Max Kellermann
848c63e2d5 output/jack: use std::atomic_bool for "shutdown" and "pause"
Without this, the compiler may optimize accesses away.
2019-08-06 11:34:00 +02:00
Max Kellermann
f6d0310f9c output/jack: use SIZE_MAX instead of (size_t)-1 2019-08-06 11:33:52 +02:00
Max Kellermann
3ef043392c input/cdio_paranoia: drop support for libcdio-paranoia older than 10.2+0.93+1
Version 10.2+0.93+1 was released five years ago in 2014 and is the
first version to feature cdio_cddap_free_messages().  There is no way
to check the libcdio-paranoia version at compile time, so let's just
remove support for older versions instead of attempting to fix the
cdio_cddap_free_messages() check at build time.

Closes https://github.com/MusicPlayerDaemon/MPD/issues/613
2019-08-06 11:09:36 +02:00
Max Kellermann
864d6f312d Revert "decoder/mad: use MAD_F_MIN and MAD_F_MAX"
This reverts commit f7ed7446ae.  It was
a bad idea, because MAD_F_MIN and MAD_F_MAX do not represent the
clamping limits, but the theoretical minimum and maximum values of the
mad_fixed_t data type.

Closes https://github.com/MusicPlayerDaemon/MPD/issues/617
2019-08-05 13:07:41 +02:00
Max Kellermann
91fb91d89c util/StringView: prepare the transition to std::string_view
Unfortunately, we need to disable this for GCC versions older than 7,
because it doesn't have <string_view> yet.
2019-08-05 10:23:05 +02:00
Max Kellermann
8b399b7133 output/jack: use jack_free() for Windows compatibility 2019-08-05 09:35:41 +02:00
Max Kellermann
9d24f68f51 output/jack: convert to class, make attributes/methods private 2019-08-05 09:31:40 +02:00
Max Kellermann
44652fdb13 output/jack: convert callback functions to static methods 2019-08-05 09:29:27 +02:00
Max Kellermann
2892a6f5e2 output/jack: merge set_audioformat() into Open() 2019-08-05 09:28:41 +02:00
Max Kellermann
2fc40e5575 output/jack: eliminate "shutdown" flag, use only "error" (mutex protected) 2019-08-05 09:24:43 +02:00
Fredrik Noring
7363fe90bb decoder/sidplay: Add "default_genre" option
Genres are not part of the SID format, so SID files are genreless. This
"default_genre" option may be used to assign a default genre to all SID
music, for example "SID", "C64", "Chiptune", etc.
2019-08-05 06:23:40 +02:00
Max Kellermann
d146bef740 output/jack: use jack_on_info_shutdown() 2019-08-04 20:25:13 +02:00
Max Kellermann
1f4c4be1f1 output/jack: use std::atomic_bool for "shutdown" and "pause"
Without this, the compiler may optimize accesses away.
2019-08-04 20:24:51 +02:00
Max Kellermann
90067d16c0 output/jack: use SIZE_MAX instead of (size_t)-1 2019-08-04 06:34:43 +02:00
Max Kellermann
cde6c46d2f util/Macros: replace with std::size() (C++17) 2019-08-03 13:10:49 +02:00
ckdo
d305f187d5 Add the ability to specify media.role for pulse output plugin
This is useful in multiple mpd instances scenario, or multiple pulse outputs defined on the same mpd instance.
It is actually a more flexible way to route flows than the "sink" parameter, letting the PulseAudio routing do its job, but with the ability to isolate routing for each output.

If not specified, the role remains like it was before this commit, ie "music"
2019-08-03 13:03:05 +02:00
Richard Dodd
4f6a713b32 Add option to not connect jack ports automatically 2019-08-03 13:01:47 +02:00
Max Kellermann
8f981845dc switch to C++17
Time to move on, two years after 2017.
2019-08-03 12:57:56 +02:00
Max Kellermann
c764b70b3a decoder/mad: merge DecodeNextFrame() and DecodeNextFrameHeader() 2019-08-03 12:55:56 +02:00
Max Kellermann
52bb03e136 decoder/mad: eliminate redundant error handling from DecodeNextFrame()
Much of that is not possible when mad_header_decode() has already been
called.
2019-08-03 12:55:48 +02:00
Max Kellermann
a90685d6cf release v0.21.12
-----BEGIN PGP SIGNATURE-----
 
 iQJEBAABCgAuFiEEA5IzWngIOJSkMBxDI26KWMbbRRIFAl1FZnQQHG1heEBtdXNp
 Y3BkLm9yZwAKCRAjbopYxttFEjrXD/0QChgJtx6sVPRpMK7KszwgpmxNkhDPA13l
 puuYTg0eEZe9EJxNM82ouCNn2kOx9OjP5DKyeus0Dt4Pk5Cwj8HGeHqjTahtwHtD
 jbVy5kiEZ57NjBoLFoQBI6vMuzcz/DKStq2HmPJ62NQCIqbiTQXPpWvDYAieTFV+
 lbM7vc7VQ6A3bhms//vYMZYmQV7T4Eam3iEVxoQhX4Pd+wWXv+XcTfdI2UTUFWIY
 mt7+AZlG2ynev+zszUtDLB4aFEbRcLUBlSKuPv3j5ox7BjleLJXltpVbisI+TDHL
 nAyb2LtOTeVPpAaqiPeCju2ucWaUOsFkHmSCjPu8BHc8b4mLATiozv2BzY1qe5rX
 G7DZxCLq3IBtY4u4FpR4kOuVcjTGFKCToHGl8N6GrPmfa3n+MqPLAqKx32tSq+r/
 po2kbB9t0IXXT1njGWLb9W6y7z/7dsvy3YgjV6L7SfY/SA9MZELx+MBED2GSDYr9
 eWLK7LDO5soBUZvnDVJZO/a1oP0n5WiSV9n2/YGgRJXcljW8tJ8C76yMNziPK7yn
 Fjmc12o6kf5Afo3dNsLAdXH4p/8LeYK9IcJZmGfwBCccMHlnX+ySLfBOyuyUDD7g
 nOV/o7av/HZzirQ9h2CGUZhBPbPARjvMI+mhDVGxUx3OYxW9UfokmMVEs4h21f0R
 4XRbOUejVA==
 =hzQJ
 -----END PGP SIGNATURE-----

Merge tag 'v0.21.12'

release v0.21.12
2019-08-03 12:53:23 +02:00
Max Kellermann
f2d8fd769d player/Thread: don't restart unseekable song after failed seek attempt
The check IsSeekableCurrentSong() was added by commit
44b200240f in version 0.20.19, but it
caused a regression: by doing the branch only if the current song is
seekable, the player would restart the current song if it was not
seekable, and later the initial seek would fail; but we already know
it's not seekable, and so we should fail early.
2019-08-03 12:30:10 +02:00
Max Kellermann
9661062ae2 decoder/mad: pass const reference to RecoverFrameError() 2019-08-03 11:59:41 +02:00
Max Kellermann
2a07354cad decoder/mad: change integers to size_t 2019-08-03 11:44:02 +02:00
Max Kellermann
fc18fd571c decoder/mad: return from SynthAndSubmit() early 2019-08-03 11:42:05 +02:00
Max Kellermann
51abed9732 decoder/mad: pass mad_pcm to mad_fixed_to_24_buffer() 2019-08-03 11:40:06 +02:00
Max Kellermann
d00afc912c decoder/mad: eliminate the loop in SubmitPCM()
libmad has a hard-coded maximum PCM buffer size; if we make our
output_buffer just as large, we can avoid the loop, because any
possible size will fit.
2019-08-03 11:36:05 +02:00
Max Kellermann
9d0fe725eb decoder/mad: rename a few misnamed methods 2019-08-03 11:32:42 +02:00
Max Kellermann
8a432c9b7f decoder/mad: move code to LoadNextFrame() 2019-08-03 11:32:06 +02:00
Max Kellermann
187204f03c decoder/mad: move code to HandleCurrentFrame() 2019-08-03 11:32:06 +02:00
Max Kellermann
5e5fadb5f2 decoder/mad: remove unnecessary initializers
These will not be used until they are initialized in SyncAndSend().
2019-08-03 08:49:26 +02:00
Max Kellermann
952c793235 decoder/mad: subtract libmad decoder delay from LAME encoder padding
Apparently, libmad not only inserts 529 samples of silence at the
beginning of the file, but also removes them at the end.

This solves the last piece of
https://github.com/MusicPlayerDaemon/MPD/issues/601

Closes https://github.com/MusicPlayerDaemon/MPD/issues/601
2019-08-03 08:35:00 +02:00
Max Kellermann
3e3d8c7f9d decoder/mad: pad the input buffer with zero bytes and end of file
libmad requires padding the input buffer with "MAD_BUFFER_GUARD" zero
bytes at the end of the file, or else it is unable to decode the last
frame.

This fixes yet another bug which prevented this plugin from decoding
the last frame, see
https://github.com/MusicPlayerDaemon/MPD/issues/601
2019-08-03 08:32:27 +02:00
Max Kellermann
9b99a9897a decoder/mad: don't count the Xing/LAME metadata frame
The Xing/LAME frame indicates how many frames there are, but that
excludes the initial Xing/LAME frame.  Therefore, it should not be
counted.

This fixes an off-by-one bug which caused the last frame to be
skipped, fixing one part of
https://github.com/MusicPlayerDaemon/MPD/issues/601
2019-08-03 08:25:48 +02:00
Max Kellermann
4f56fdc397 decoder/mad: make "current_frame" zero-based
Increment "current_frame" after processing the frame.
2019-08-03 08:24:25 +02:00
Max Kellermann
c87d6825ec decoder/mad: add API documentation 2019-08-03 08:07:30 +02:00
Max Kellermann
00830a20e3 decoder/mad: convert to class, make almost everything private 2019-08-03 07:52:51 +02:00
Max Kellermann
d39d2874b4 decoder/mad: move code to methods RunDecoder(), RunScan() 2019-08-03 07:49:41 +02:00
Max Kellermann
a0a74951b8 decoder/mad: eliminate attribute "bit_rate"
This also fixes a bug which caused the bit rate to not update after
seeking.
2019-08-03 00:38:45 +02:00
Max Kellermann
779a6855ff decoder/mad: add noexcept 2019-08-03 00:28:59 +02:00
Max Kellermann
f7ed7446ae decoder/mad: use MAD_F_MIN and MAD_F_MAX 2019-08-03 00:27:59 +02:00
Max Kellermann
9d44a6d2ae decoder/mad: use Clamp() 2019-08-03 00:26:57 +02:00
Max Kellermann
10da9ee7ba decoder/mad: refactor local variables in FillBuffer() 2019-08-02 23:19:11 +02:00
Max Kellermann
f9eff31205 decoder/mad: use sizeof(input_buffer) 2019-08-02 23:19:11 +02:00
Max Kellermann
1d74a029a2 decoder/mad: simplify variable initialization in FillBuffer() 2019-08-02 23:19:11 +02:00
Max Kellermann
6b8ca514bb decoder/mad: fix broken log message
Broken since commit f8bfea8bae
2019-08-02 22:58:16 +02:00
Max Kellermann
f51e555154 decoder/mad: change "mp3_" suffix to "mad_" 2019-08-02 22:49:55 +02:00
Max Kellermann
61a3c69a06 decoder/mad: make enums strictly-typed 2019-08-02 22:49:55 +02:00
Max Kellermann
089615a01e decoder/mad: include cleanup 2019-08-02 22:49:55 +02:00
Max Kellermann
52bee8f81f util/StaticFifoBuffer: add GetAvailable() 2019-08-02 22:49:55 +02:00
Max Kellermann
adc25e648f util/StaticFifoBuffer: add constexpr 2019-08-02 22:49:33 +02:00
Max Kellermann
31da8eac9b util/StaticFifoBuffer: add noexcept 2019-08-02 22:49:05 +02:00
Max Kellermann
e00464435b util/Compiler.h: move compiler version checks to meson.build 2019-08-02 15:53:16 +02:00
Diomendius
b81138bda1 Fix JACK plugin outputting only to left channel
The JACK output plugin would not correctly upmix mono input files when exactly 2 output ports were configured. This fixes that.
2019-08-02 15:52:20 +02:00
Max Kellermann
fe2f8c088a Partition, ...: add noexcept to callback methods 2019-08-02 14:44:00 +02:00
Max Kellermann
6de088140b lib/xiph/OggVisitor: invoke OnOggPacket() with the "E_O_S" packet
The "end of stream" packet is not special; it contains normal data,
and thus we should pass it to OnOggPacket().

This fixes one part of https://github.com/MusicPlayerDaemon/MPD/issues/601
2019-08-02 14:04:08 +02:00
Max Kellermann
86d0534638 lib/xiph/OggVisitor: more API documentation 2019-08-02 13:56:00 +02:00
Max Kellermann
af99f9fc90 pcm/Volume: convert S16 to S24 to preserve quality and reduce noise
Applying software volume to S16 samples means several bits of
precision are lost; at 25% volume, two bits are lost.  Additionally,
dithering adds some noise.

The problem gets worse when you apply the software volume code twice:
for the software mixer volume, and again for the replay gain.  This
loses some more precision and adds even more dithering noise, which
can become audible (see
https://github.com/MusicPlayerDaemon/MPD/issues/542).

By converting everything to 24 bit, we need to shift only two bits to
the right instead of ten, losing nearly no precision, and dithering is
not needed.  Even if the output device is unable to play S24 directly,
we can convert back to S16 with only one stage of dithering.

Closes https://github.com/MusicPlayerDaemon/MPD/issues/542
2019-07-30 20:03:37 +02:00
Max Kellermann
a784c8b1ae net/Resolver: replace memset(0) with empty C++ initializer list 2019-07-29 11:32:06 +02:00
Max Kellermann
991bbea875 Merge branch 'v0.21.x' 2019-07-29 11:32:00 +02:00
Max Kellermann
1033dbca2b playlist/Song: add missing includes 2019-07-29 11:31:30 +02:00
Max Kellermann
a2d2210713 ls: fix early return in uri_supported_scheme()
Fixes regression by commit 4e2a551f30

Closes https://github.com/MusicPlayerDaemon/MPD/issues/599
2019-07-29 11:08:47 +02:00
Max Kellermann
b955334882 decoder/opus: ignore case in replay gain tag names
Closes https://github.com/MusicPlayerDaemon/MPD/issues/604
2019-07-29 10:40:37 +02:00
Max Kellermann
90ea3bf985 playlist/Song: support backslash in relative URIs
Closes https://github.com/MusicPlayerDaemon/MPD/issues/607
2019-07-29 09:58:53 +02:00
Max Kellermann
426891ab31 output/Init: pass MixerType to _load_mixer() 2019-07-12 17:11:14 +02:00
Max Kellermann
b94de51ac4 system/Error: move code to IsErrno() 2019-07-12 17:11:14 +02:00
Max Kellermann
db024c27d5 output/Source: allow the ReplayGainFilter to change the AudioFormat
Just in case.
2019-07-08 20:16:53 +02:00
Max Kellermann
326c6ae615 pcm/Volume: add variable "dest_size" 2019-07-05 21:01:09 +02:00
Max Kellermann
5fa7610264 pcm/Volume: Open() returns output sample format
Prepare for a new mode which may convert to a different sample format
when applying volume, to reduce dithering.
2019-07-05 19:03:00 +02:00
Max Kellermann
1c757f8c1c pcm/Volume: allow any exception 2019-07-05 19:01:46 +02:00
Max Kellermann
06fbbe2d7b pcm/Volume: calculate PCM_VOLUME_1 2019-07-05 18:26:26 +02:00
Max Kellermann
21d91cb1d1 pcm/Volume: fix API documentation 2019-07-05 18:26:14 +02:00
Max Kellermann
9d3d4fc734 util/CharUtil: add noexcept 2019-07-05 18:05:04 +02:00
Max Kellermann
d6660bad03 util/WCharUtil: remove redundant inline keywords from constexpr functions 2019-07-05 18:03:42 +02:00
Max Kellermann
9d74b1a212 IcyMetaDataParser: include cleanup 2019-07-05 17:27:39 +02:00
Max Kellermann
54c7dc029e IcyMetaDataParser: remove useless log message 2019-07-05 17:26:31 +02:00
Max Kellermann
d8bcdca7ff IcyMetaDataParser: pass StringView to icy_add_item() 2019-07-05 17:17:44 +02:00
Max Kellermann
d663f81420 include cleanups (powered by iwyu) 2019-07-05 09:59:58 +02:00
Max Kellermann
9cdebc90a0 lib/icu/Compare: use StringIsEqualIgnoreCase() 2019-07-05 09:59:58 +02:00
Max Kellermann
4650a903b4 decoder/Bridge: add noexcept 2019-07-05 08:57:51 +02:00
Max Kellermann
94c9fafe16 lib/chromaprint/DecoderClient: catch and postpone InputStream::LockRead() errors 2019-07-05 08:36:14 +02:00
Max Kellermann
8480b834b3 encoder/Interface: add noexcept 2019-07-04 22:44:36 +02:00
Max Kellermann
07080574a2 encoder/Interface: allow throwing any exception 2019-07-04 22:44:11 +02:00
Max Kellermann
6c22c34300 output/oss: add noexcept 2019-07-04 22:42:19 +02:00
Max Kellermann
f54710b100 output/oss: replace enum oss_setup_result with bool
It's not a tri-state anymore since we introduced C++ exceptions.
2019-07-04 22:23:22 +02:00
Max Kellermann
196db1a8c8 output/oss: remove redundant DoClose() calls from Reopen() 2019-07-04 22:01:44 +02:00
Max Kellermann
d66ef7eac1 lib/alsa/HwSetup: don't reset dsd_mode
Fixes regression by commit 28e07e900f

Closes https://github.com/MusicPlayerDaemon/MPD/issues/596
2019-07-04 12:47:35 +02:00
Max Kellermann
0a32634d8f output/alsa: check ring buffer space before writing to it
Pass only the amount of data to PcmExport::Export() when its full
output fits into the ring buffer.  Using only a part of the
PcmExport::Export() result may cause data corruption because
PcmExport's internal state may contain partial blocks which would need
to be rolled back when only some of its output data was used.

As a side effect, this fixes an assertion failure because
PcmExport::CalcInputSize() considered partial block data and could
cause Play() to return a number larger than the "size" parameter.
2019-07-04 12:47:10 +02:00
Max Kellermann
b12fc3c60d output/alsa: throw unexpected snd_pcm_writei() errors
If snd_pcm_writei() fails, throw an error and stop playback instead
of going into an endless busy loop.
2019-07-04 12:46:18 +02:00
Max Kellermann
6d013b092f output/osx: remove trailing newline from exception messages 2019-07-03 22:21:43 +02:00
Max Kellermann
ccb182865c output/osx: fix coding style 2019-07-03 22:12:47 +02:00
Max Kellermann
412b04be58 output: allow throwing any exception 2019-07-03 22:10:26 +02:00
Max Kellermann
510e6841a0 net/AllocatedSocketAddress: import std::swap 2019-07-03 22:06:40 +02:00
Max Kellermann
2089c99348 net/{Allocated,Static}SocketAddress: use IPv[46]Address::SetPort() 2019-07-03 21:59:23 +02:00
Max Kellermann
77b5b4158c net/ToString: move UnmapV4() to class IPv6Address 2019-07-03 21:56:56 +02:00
Max Kellermann
08552f3938 net/ToString: UnmapV4() returns IPv4Address 2019-07-03 21:56:27 +02:00
Max Kellermann
2700265769 net/SocketAddress: use IPv[46]Address::Cast() 2019-07-03 21:53:42 +02:00
Max Kellermann
557098644b release v0.21.11
-----BEGIN PGP SIGNATURE-----
 
 iQJEBAABCgAuFiEEA5IzWngIOJSkMBxDI26KWMbbRRIFAl0cqqwQHG1heEBtdXNp
 Y3BkLm9yZwAKCRAjbopYxttFErtoD/0Qmma/ltv/D7+m+ZugDLUejxJ/SGEPJNVS
 To2yy87TqwcgRcmrlwp05epxxqm54LmE8z3748iIS76zBySc4lA8OHWCNCNs0lrc
 gbUOmUM9ZE89oXppEfjLlqIofSJVLw8rY+8RMtybKeKaJ3/4JlDySMw92UuZ3LMJ
 woqAZPUOPGYsT1KBjblWsRYkn5broOZ3m2zt6e5r09ICudKQjvS6gXT3wmNqmDEU
 cos2taYNGyi42ywVJzeAPVOO/MecS+WXZIIR0y5TvslDhKkTHIo2SS1qcNM2tCdg
 c5s+vQUtZkFmKK3fr4H861cWQelRbBFY4Fy/Shrz2FMZj7eUExH/eXaxX8I7S8tX
 f0H2y944AXwlFJrIQylnSgx4x9E+ye/Mqc8O4hmSA9KHfrWDWegcbB5S2v6zt1e9
 BmiWClH5Ts1beNmT5F9nExFLZjQzxwFTsm44HJhOK+poULRo+WQLllcAsCRjNw8s
 7EzPF/UmBcydeyWYmoPhXiexAFaIDx9B+n2SlgekdvxeneXHZMskkpyysLNVde3o
 1jXH0dBdm8rj8Xp2zm9t5yjnCy2iKPO5oVdZ+keTM9olG3Er+ar5ofT78n0xbEFW
 h7PikktbqWYeF01QjfSsHO7bhOVkvLtMNLZG1gtBGMI5qUWdnC/2HbTZWRHVeAKe
 wFxdx2MBwg==
 =4kRo
 -----END PGP SIGNATURE-----

Merge tag 'v0.21.11'

release v0.21.11
2019-07-03 15:36:45 +02:00
Max Kellermann
44aaf51345 Merge branch 'runtime_enumeration' of git://github.com/eugene2k/MPD 2019-07-01 09:48:33 +02:00
Eugene Gorodinsky
4e2a551f30 Add runtime enumeration of supported schemas.
Fix src/ls.cxx to only print unique schemas.
Refactor src/ls.cxx to use src/input/InputPlugin functionality.

Add dynamic enumeration support to curl plugin.
2019-07-01 09:49:34 +03:00
Max Kellermann
f780ac418a output/alsa: log when generating silence due to slow decoder
MPD used to do that when this code lived in the player thread, but it
was removed by commit 98a7c62d7a4f716d90af6d78e18d1a3b10bc54b3; and
the replacement code in the ALSA output plugin didn't have it.
2019-06-28 18:15:30 +02:00
Max Kellermann
61a72a5d13 output/alsa: schedule a timer to generate silence
Without this timer, DispatchSockets() may disable the
MultiSocketMonitor and if Play() doesn't get called soon, it never
gets a chance to generate silence.  However if Play() gets called,
generating silence isn't necessary anymore...

Resulting from this misdesign (added by commit ccafe3f3cf in 0.21.3),
the silence generator didn't work reliably.
2019-06-28 18:04:49 +02:00
Max Kellermann
0c0a354753 output/alsa: add a new flag "waiting" for xrun management
In DispatchSockets(), when there was not enough data, but enough for
current playback, the method would disable the "active" flag so the
next Play() call would re-enable the MultiSocketMonitor.

This was an abuse of the flag which could result in a crash
in Cancel(), because that method asserts that the period_buffer is
empty, which it may be not.

The solution is to add anther flag called "waiting" which shares some
behavior with the old flag.
2019-06-28 18:04:49 +02:00
Max Kellermann
3c5f860fb8 output/alsa: Cancel() also affects "active" (documentation) 2019-06-28 18:04:49 +02:00
Max Kellermann
3da1fa88d0 output/alsa: fix comment typo 2019-06-28 18:04:49 +02:00
Max Kellermann
fac15aaffb output/alsa: fix comment typo 2019-06-28 14:39:54 +02:00
Max Kellermann
5b01373356 output/alsa: more assertions in class PeriodBuffer 2019-06-28 09:31:51 +02:00
Max Kellermann
a92aa0bedc output/alsa: use IsCleared() instead of IsDrained() in DrainInternal()
Really drain all data from the period_buffer in any case.
2019-06-28 09:30:33 +02:00
Max Kellermann
d66f5a8590 output/alsa: replace PeriodBuffer::IsEmpty() with IsCleared()
This assertion is not about whether all data has been consumed, but
about whether there has been any data at all.
2019-06-28 09:29:18 +02:00
Max Kellermann
30ca6b8881 Merge branch 'v0.21.x' 2019-06-28 09:28:04 +02:00
Max Kellermann
c926021599 output/alsa: always redo DrainInternal() after writing
Draining isn't finished just because the period_buffer has run empty.
It is only finished after snd_pcm_drain() has succeeded.
2019-06-28 09:10:16 +02:00
Max Kellermann
543776d9c9 output/alsa: check PCM state before calling snd_pcm_drain()
Apparently, if snd_pcm_drain() returns EAGAIN, it does not actually
want to be called again; the next call will snd_pcm_drain() will also
return EAGAIN, forever, even though the PCM state has meanwhile
switched to SND_PCM_STATE_SETUP.  This causes a busy loop; to fix
this, we should always check snd_pcm_state() to see if draining is
really required.
2019-06-28 08:55:25 +02:00
Max Kellermann
cf631fca50 output/alsa: check GetFrames()>0 instead of IsEmpty() in WriteFromPeriodBuffer() 2019-06-27 21:59:43 +02:00
Max Kellermann
f0ac63d5af output/alsa: DrainInternal() ignores postponed partial frame 2019-06-27 21:23:28 +02:00
Max Kellermann
c1eb0583c4 output/alsa: add "full" assertion to WriteFromPeriodBuffer() 2019-06-27 21:22:52 +02:00
Max Kellermann
549faa8a9c output/alsa: add full check before calling FillWithSilence() 2019-06-27 21:20:38 +02:00
Max Kellermann
8f6c750064 output/alsa: improve silence generator test in DrainInternal()
There cannot be partial frames in the buffer, so we don't need
GetPeriodPosition(); it's enough to check whether head has been moved
in this period.
2019-06-27 21:17:37 +02:00
Max Kellermann
9fc1668de3 output/alsa: hold back snd_pcm_writei() until period_buffer is full
This gives MPD more control, because attempts to avoid having partial
periods in the ALSA period buffer.  For example, this means that
DrainInternal() doesn't need to generate silence to fill the partial
period.
2019-06-27 15:40:07 +02:00
Max Kellermann
e9190f4249 lib/alsa/PeriodBuffer: add missing include 2019-06-27 15:34:40 +02:00
Max Kellermann
127b464c59 lib/alsa/PeriodBuffer: add API documentation 2019-06-27 14:58:19 +02:00
Max Kellermann
01fd6e5e82 Merge branch 'v0.21.x' 2019-06-27 14:51:05 +02:00
Max Kellermann
8bf3f9b874 input/tidal: deprecated because Tidal has changed the protocol
See https://github.com/MusicPlayerDaemon/MPD/issues/545
2019-06-26 23:14:07 +02:00
Max Kellermann
f07f8f7d88 decoder/wildmidi: add fallbacks for libwildmidi<0.4
Fix build breakage from commit ea639269d8
2019-06-26 23:13:23 +02:00
Max Kellermann
39b40ac1fd decoder/wildmidi: remove unused variable wildmidi_domain 2019-06-26 23:10:20 +02:00
Max Kellermann
ea639269d8 decoder/wildmidi: throw PluginUnavailable on WildMidi_Init() error
Closes https://github.com/MusicPlayerDaemon/MPD/issues/589
2019-06-26 22:40:27 +02:00
Max Kellermann
0abaa3ecc5 decoder/wildmidi: throw PluginUnavailable if config file does not exist
This makes the configuration error more visible, possibly addressing
one part of https://github.com/MusicPlayerDaemon/MPD/issues/589
2019-06-26 22:38:40 +02:00
Max Kellermann
c4d3efe71d decoder/List: handle exception PluginUnavailable 2019-06-26 22:02:54 +02:00
Max Kellermann
85e82e3d4d decoder/List: annotate exceptions thrown by DecoderPlugin::Init() 2019-06-26 22:01:45 +02:00
Max Kellermann
beed004b10 pcm/Export: add GetSilence() 2019-06-26 16:04:46 +02:00
Max Kellermann
34c6337887 pcm/Export: add GetInputBlockSize(), GetOutputBlockSize() 2019-06-26 15:49:08 +02:00
Max Kellermann
2093e53641 pcm/Export: add GetInputFrameSize() 2019-06-26 15:48:18 +02:00
Max Kellermann
2f243f2295 pcm/Export: rename GetFrameSize() to GetOutputFrameSize() 2019-06-26 15:46:49 +02:00
Max Kellermann
e69fd0300a pcm/Export: rename CalcSourceSize() to CalcInputSize() 2019-06-26 15:46:05 +02:00
Max Kellermann
f43cafbf7d pcm/Export: eliminate the AudioFormat parameter from GetFrameSize() 2019-06-26 15:42:47 +02:00
Max Kellermann
53faf77d20 pcm/Export: use the "channels" attribute in GetFrameSize() 2019-06-26 15:41:07 +02:00
Max Kellermann
bf574dcb0a pcm/RestBuffer: make internal methods private 2019-06-26 14:44:20 +02:00
Max Kellermann
72b8f33272 pcm/Export: split src_sample_format from alsa_channel_order
Combining these two in one single value saves some memory, but is
complicated and we may need the src_sample_format for new features
later.
2019-06-18 12:19:40 +02:00
Max Kellermann
a17f420d6b pcm/Export: update API documentation 2019-06-18 12:19:40 +02:00
Max Kellermann
f97a9ce765 Revert "MusicChunk: pad MusicChunkInfo to a multiple of 8 bytes"
This reverts commit 2c3eeb7194.  This
workaround has been obsoleted by commits
bf26adf555 and
32380d1db0
2019-06-18 11:49:52 +02:00
Max Kellermann
bf26adf555 pcm/Dsd{16,32}: stash odd frames away for the next call
Similar to commit 32380d1db0, these are
the final parts for really fixing
https://github.com/MusicPlayerDaemon/MPD/issues/469
2019-06-18 11:19:27 +02:00
Max Kellermann
0cc94fe30c pcm/Dsd{16,32}: convert public function to stateful class 2019-06-18 10:58:55 +02:00
Max Kellermann
d5d5705213 pcm/Export: update API documentation 2019-06-18 10:58:26 +02:00
Max Kellermann
96d74e77eb pcm/Dsd{16,32}: move the conversion loop to a separate function 2019-06-17 22:51:01 +02:00
Max Kellermann
ca8451cdbc tag/Type: add tag "Work"
Closes https://github.com/MusicPlayerDaemon/MPD/issues/577
2019-06-17 22:40:36 +02:00
Max Kellermann
28e07e900f pcm/Export: convert the DSD bools to an enum
These options are exclusive.
2019-06-17 22:35:00 +02:00
Max Kellermann
c75dc4a647 output/osx: remove redundant initializer 2019-06-17 22:35:00 +02:00
Max Kellermann
32380d1db0 pcm/Dop: stash odd frames away for the next call
First part of the "real" fix for
https://github.com/MusicPlayerDaemon/MPD/issues/469
2019-06-17 22:18:44 +02:00
Max Kellermann
c9f1354e4d pcm/RestBuffer: new utility class 2019-06-17 22:18:41 +02:00
Max Kellermann
e3f9e96eef pcm/Dop: convert public function to stateful class
Preparing to add more state.
2019-06-17 22:16:29 +02:00
Max Kellermann
8f9b3cbf0e pcm/Dop: add separate dsd_buffer for DSD_U16/32
The dop_buffer will be moved out soon.
2019-06-17 22:11:23 +02:00
Max Kellermann
458a1beed9 AudioFormat: move MAX_CHANNELS to pcm/ChannelDefs.hxx
Reduce header dependencies.
2019-06-17 22:11:08 +02:00
Max Kellermann
47bb1cd8b5 output/{alsa,osx}: use ConstBuffer::empty() 2019-06-17 22:09:47 +02:00
Max Kellermann
ccc96e25d3 output/{alsa,osx}: remove comment after PcmExport::Export()
Returning an empty buffer is a normal result now (since commit
79839db3a3), and doesn't deserve such a
big comment.
2019-06-17 22:09:06 +02:00
Max Kellermann
33f5e03e80 Merge branch 'v0.21.x' 2019-06-17 22:06:54 +02:00
Max Kellermann
2c3eeb7194 MusicChunk: pad MusicChunkInfo to a multiple of 8 bytes
Workaround for a regression caused by commit
a06bf388d9, revealing a problem with
discarding odd numer of frames in the DSD_U32 and DoP converters,
causing distortions with DSD_U32 and DoP on 32 bit CPUs.

Closes https://github.com/MusicPlayerDaemon/MPD/issues/469
2019-06-17 21:24:32 +02:00
Max Kellermann
79839db3a3 output/oss: return early if PcmExport::Export() returns empty array
This can happen if the DoP converter doesn't get enough source samples
for one destination quad.  This isn't a critical bug, because the OSS
plugin doesn't support DoP yet, but it's good to be prepared.
2019-06-17 21:07:30 +02:00
Max Kellermann
d478bdda8e pcm/Export: document that Export() may return an empty buffer 2019-06-17 21:07:29 +02:00
Max Kellermann
fd7caab872 output/winmm: fix build breakage after e87f0ca771 2019-06-17 12:23:34 +02:00
Max Kellermann
e87f0ca771 pcm/Pcm*: drop more "Pcm" prefixes from source file names 2019-06-17 11:17:48 +02:00
Max Kellermann
a139279575 Copyright year 2019 2019-06-17 11:17:30 +02:00
Max Kellermann
9fcd33cc8d pcm/Dop: move the conversion loop to separate function 2019-06-16 12:23:48 +02:00
Max Kellermann
96ff6b9b8b pcm/Dop: remove redundant inline keywords 2019-06-16 12:23:38 +02:00
Max Kellermann
fd5e74dbd0 pcm/Pcm{Dop,Export}: drop "Pcm" prefix 2019-06-16 12:11:44 +02:00
Max Kellermann
b64571f4a5 pcm/Export: update API documentation 2019-06-16 11:52:57 +02:00
Max Kellermann
1eae9339f2 db/Interface: CollectUniqueTags() allows multiple "groups"
Instead of passing tag and group, pass an array of tags.  To support a
nested return value, return a nested std::map of std::maps.  Each key
specifies the tag value, and each value may be another nesting level.

Closes https://github.com/MusicPlayerDaemon/MPD/issues/408
2019-06-16 10:39:29 +02:00
Max Kellermann
22a9e866bc decoder/mad: make enums strictly-typed 2019-06-16 10:02:51 +02:00
Max Kellermann
97e6ea57c4 decoder/mad: change "mp3_" suffix to "mad_" 2019-06-16 10:01:10 +02:00
Max Kellermann
527642a90b decoder/Plugin: simplify compile-time initialization
Add a `constexpr` constructor and several `constexpr` methods to
construct a DecoderPlugin at compile time, in a way which allows
adding new methods later without having to edit each plugin.
2019-06-15 14:44:37 +02:00
Max Kellermann
aebb1baad8 decoder/sidplay: remove redundant extern 2019-06-15 14:36:12 +02:00
Max Kellermann
bd6b7aa88e archive/Lookup: move to fs/LookupFile.cxx
This can be used for other purposes as well.
2019-06-15 14:26:26 +02:00
Max Kellermann
fcf6415963 archive/Lookup: pass class Path 2019-06-15 14:06:50 +02:00
Max Kellermann
be79b44dc8 archive/Lookup: pass const pointer 2019-06-15 14:04:34 +02:00
Max Kellermann
17f207ffd1 archive/Lookup: return AllocatedPath 2019-06-15 13:57:28 +02:00
Max Kellermann
476647bfa0 fs/AllocatedPath: add GetSuffix() 2019-06-15 13:57:16 +02:00
Max Kellermann
9f246fc0dc archive/Lookup: use PathTraitsFS::pointer_type 2019-06-11 19:42:16 +02:00
Max Kellermann
7de6e4dbac playlist/Registry: eliminate MIME type copy 2019-06-11 19:32:45 +02:00
Max Kellermann
15dbb8082e playlist/Registry: pass StringView to playlist_list_open_stream_mime2() 2019-06-11 19:31:22 +02:00
Max Kellermann
1a7e3bb358 util/StringUtil: add StringArrayContainsCase() overload with StringView 2019-06-11 19:29:40 +02:00
Max Kellermann
74380d2ae4 playlist/Registry: use initializer instead of memset() 2019-06-11 19:27:59 +02:00
Max Kellermann
d43ce8413a playlist/Plugin: update API documentation 2019-06-11 19:26:15 +02:00
Max Kellermann
3055c1266d output/osx: don't use variable-length arrays 2019-06-08 11:51:15 +02:00
Max Kellermann
931c3a1de0 output/osx: convert int to size_t 2019-06-08 11:49:15 +02:00
Yue Wang
a7b30fcb9e
add missing header.
bad_alloc depends on <new>
2019-06-07 21:59:31 -07:00
Max Kellermann
e153407b51 tag/Id3Scan: eliminate a string copy in UFID importer 2019-06-06 13:42:14 +02:00
Max Kellermann
5675431eaf tag/ApeTag: use IterableSplitString
Eliminates yet another string copy.
2019-06-06 13:32:39 +02:00
Max Kellermann
8a136b79e5 decoder/opus: pass StringView to ScanOneOpusTag() 2019-06-06 13:27:17 +02:00
Max Kellermann
dffa25c55e decoder/opus: use StringView::Split() 2019-06-06 13:26:35 +02:00
Max Kellermann
72a0aeb265 util/NumberParser: add overload with StringView 2019-06-06 13:26:30 +02:00
Max Kellermann
e556cd20f7 util/NumberParser: add noexcept 2019-06-06 13:26:30 +02:00
Max Kellermann
80ec6f976c tag/Table: add StringView overloads 2019-06-06 13:23:16 +02:00
Max Kellermann
589639f80f tag/ParseName: add StringView overloads 2019-06-06 13:21:33 +02:00
Max Kellermann
548aa00111 tag/Handler: pass StringView to OnTag() and OnPair()
Eliminates a number of allocations, because callers don't need to copy
the strings to a newly allocated buffer only to null-terminate them.
And most callers don't need to have a null-terminated string.
2019-06-06 13:00:53 +02:00
Max Kellermann
76eb550011 util/StringView: add method Split() 2019-06-06 12:54:42 +02:00
Max Kellermann
c1719a5200 lib/xiph/FlacStreamMetadata: add missing include 2019-06-06 12:54:42 +02:00
Max Kellermann
b07bbb928a decoder/dsdiff: allow longer tag values 2019-06-06 12:44:25 +02:00
Max Kellermann
3b5a128097 decoder/dsdiff: pass DecoderClient* to dsdiff_handle_native_tag() 2019-06-06 12:43:20 +02:00
Max Kellermann
3eae3a2826 queue/Queue: allocate MoveRange() buffer on the heap
No variable-length arrays on the stack.
2019-06-06 12:39:42 +02:00
Max Kellermann
3c1f7c77f0 queue/Queue: remove outdated API documentation 2019-06-06 12:38:21 +02:00
Max Kellermann
3e40b1d9d2 decoder/dsdiff: use a fixed-size buffer for the tag value
Variable-length arrays are a C-only feature.
2019-06-06 12:33:14 +02:00
Max Kellermann
adffbba2a5 release v0.21.10
-----BEGIN PGP SIGNATURE-----
 
 iQJEBAABCgAuFiEEA5IzWngIOJSkMBxDI26KWMbbRRIFAlz4JuAQHG1heEBtdXNp
 Y3BkLm9yZwAKCRAjbopYxttFEq9nD/40/ryDwvgsQnKhYcpPhlV8bf8iTOUSPsrW
 2P5m48sfGb3LBHV+U/sHLWH8svODSxloyvyxYSUOEJyqOu42lj0BnxPBDvRwTjcq
 PxJPHHKVuExys04k4SOKIEci742WEHTVRzO8EeOvIdgkjXCak7tpQk/wmhrGfHF1
 +rLfSu6jq90/tELsOyTLGmk3KapY637Qf2Q99Z6VZnAXhIRLK4O1E8oKGOjl2h8I
 xvjZckVZV1FYeNrC0OYdNQX0A+JhkFwLFAeWP3ksBmKfs+Csf8X0JTCofnYph46t
 5SmhTd9I6NEVnNoZyOplV7QVawGPK1p69ORB052d/9QUhMqcPmwnHrhcrWtrYl5I
 6QtUwf8nJz/TnUc7/a3BBIPHLB/PD0fGsmdDoElikkPz76sGYNor+UZIdQke1HQL
 m3zmNDxjU++sRfrSjAPOK2mxD0Km8tYIcrQBMZcyxoc7GCHaw1pIa2cxxs1aB5QZ
 gFxYICL7LJ+g5Q19JhTiWlwfdOS7jGH7mVUjhLDA/mcxGf6ln6FkDx58GqPJV+es
 UcWVbOjb3T448TVNH0Jj+FrtWK5uBmOFNTk102BbTnfDT8muedbRmRCxn0NyKkFQ
 dS8/FdU7ffw2II49ZI6BfmeLucfoTwuQ1Ky297K/62NrM67/1dKKkBLAE3/aGxwh
 xzIDTT3Mkg==
 =SELi
 -----END PGP SIGNATURE-----

Merge tag 'v0.21.10'

release v0.21.10
2019-06-05 22:38:54 +02:00
Max Kellermann
3fae2150f5 decoder/OpusReader: return StringView
Since we now don't duplicate all items, we can easily remove the 64kB
limit from OpusReader::ReadString() and instead silently ignore and
skip all strings which are longer than 4 kB.

This fixes a tag duplication bug with Opus file containing a very long
`METADATA_BLOCK_PICTURE` tag, which occurred because the Opus plugin
returned false after parsing all tags, and then the MPD core fell back
to FFmpeg which scanned the tags again.
2019-06-05 22:19:35 +02:00
cathugger
f9ca2f52c1 output/httpd: reject some well-known request paths
Return `404 not found` for some common well-known paths, as clients requesting them usually do that automatically and don't expect endless audio stram.

Closes #572
2019-06-05 21:53:46 +02:00
cathugger
4b81cf0c2c output/httpd: use strncmp instead of memcmp
memcmp use may result in out of bounds access
2019-06-05 21:53:46 +02:00
Max Kellermann
e7acbf112c output/httpd: fix indent 2019-06-05 21:53:43 +02:00
Max Kellermann
120e570da7 archive/Domain: remove unused library 2019-06-04 17:54:59 +02:00
Max Kellermann
0019231a37 archive/Lookup, input/Archive: remove useless log messages 2019-06-04 17:54:35 +02:00
Max Kellermann
9ae1256ae7 input/archive: include cleanup 2019-05-31 19:59:09 +02:00
Max Kellermann
e1ac377812 archive/ArchiveLookup: replace output parameters with a struct 2019-05-31 19:56:25 +02:00
Max Kellermann
7866d1a005 archive/meson.build: move ArchiveLookup.cxx to archive_glue.a
Fixes the Windows build.
2019-05-31 19:56:13 +02:00
Max Kellermann
3e3ee581a8 fs/Path: add constexpr 2019-05-31 19:47:50 +02:00
Max Kellermann
0e8ca44968 archive/List: disallow passing suffix==nullptr to archive_plugin_from_suffix() 2019-05-31 19:05:26 +02:00