Commit Graph

12133 Commits

Author SHA1 Message Date
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
Max Kellermann
12e75a523a archive/ArchiveLookup: remove "suffix" output parameter
Let the caller do this.  Our GetSuffix() function was broken anyway.
2019-05-31 19:01:22 +02:00
Max Kellermann
508ba22789 archive/ArchiveLookup: use class FileInfo 2019-05-31 18:55:27 +02:00
Max Kellermann
fa13648f2c archive/ArchiveLookup: throw on error 2019-05-31 18:52:11 +02:00
Max Kellermann
2f83ed90d0 archive/iso9660: implement seeking 2019-05-31 18:40:24 +02:00
Max Kellermann
5d74b5cee1 input/cache: first draft of the file cache 2019-05-31 17:49:52 +02:00
Max Kellermann
e8a0ce643a tag/Generic: fail if InputStream is not seekable 2019-05-31 17:49:37 +02:00
Max Kellermann
9ed4fac341 input/InputStream: check offset in Rewind()
Don't call Seek() if the stream is already at the beginning.  This
avoids unnecessary exceptions if seeking is not implemented by an
Inputstream implementation.
2019-05-31 17:47:16 +02:00
Max Kellermann
81b2b4a85c Merge branch 'v0.21.x' 2019-05-31 17:27:20 +02:00
Max Kellermann
304d45b551 Revert "player/Thread: remove unnecessary "pipe" check"
This reverts commit ff3e2c0514.  The
check was necessary, after all, because this is what checked whether
the decoder had finished the current or the next song.

> The "queued" flag can only possibly be set if the decoder is still
> decoding the current song or if the decoder is stopped.

That was wrong because ProcessCommand() sets `queued=true` and also
starts the decoder (if it was idle).

> This is also what the following assert() checks.

That was also wrong, because the assert() has two conditions.

Closes https://github.com/MusicPlayerDaemon/MPD/issues/566
2019-05-31 17:23:12 +02:00
Max Kellermann
7739b3960c mixer/Listener: add noexcept 2019-05-31 14:09:47 +02:00
Max Kellermann
11ec7117ab Partition: add noexcept 2019-05-31 14:07:33 +02:00
Max Kellermann
c3ccbfd407 queue/Playlist: add noexcept 2019-05-31 13:58:57 +02:00
Max Kellermann
de3cd96c76 queue/Playlist: remove destructor 2019-05-31 13:58:57 +02:00
Max Kellermann
d8cf7d1ef0 queue/Playlist: use C++11 initializers 2019-05-31 13:58:57 +02:00
Max Kellermann
57de2470f1 queue/Listener: add noexcept 2019-05-31 13:57:46 +02:00
Max Kellermann
8fef4af7b2 decoder/Bridge: add method OpenLocal() 2019-05-30 17:08:09 +02:00
Max Kellermann
cfb678d618 config/Parser: work around conflicting macro MAX_INPUT
linux/limits.h defines MAX_INPUT which breaks the build.
2019-05-30 16:10:01 +02:00
Max Kellermann
4eb101f046 config/Parser: add ParseSize()
Supports suffixes such as "kB" and "MB".
2019-05-29 22:44:05 +02:00
Max Kellermann
af7970337b config/Parser: get_bool() throws on error 2019-05-29 22:35:40 +02:00
Max Kellermann
96a37da03d config/Block: add method With() 2019-05-29 22:35:36 +02:00
Max Kellermann
ece35552fe config/Block: add ThrowWithNested() 2019-05-29 22:33:51 +02:00