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