Commit Graph

311 Commits

Author SHA1 Message Date
Max Kellermann
72008d951b output/httpd: no mutex lock while reading data from encoder 2017-02-19 20:45:16 +01:00
Max Kellermann
72146e7800 output/httpd: use std::lock_guard 2017-02-19 20:43:45 +01:00
Max Kellermann
f7af1bb8e2 output/httpd: cancel the DeferredMonitor in Close() 2017-02-19 20:41:34 +01:00
Max Kellermann
f88f1fca3f output/httpd: move Close() lock into the I/O thread
Fixes a potential deadlock introduced by commit 945287358b
2017-02-19 20:41:06 +01:00
Max Kellermann
26e4a40cc7 output/httpd/Page: use std::shared_ptr instead of class RefCount 2017-02-19 20:17:57 +01:00
Max Kellermann
8b1931072a output/httpd/Page: no variable size, use AllocatedArray
Using variable-size objects is not worth the trouble here.  Let's drop
this and use existing and simpler code.
2017-02-19 20:13:41 +01:00
Max Kellermann
45e15b6cc6 output/httpd/Page: make all attributes private 2017-02-19 20:13:35 +01:00
Max Kellermann
be7e52c882 output/httpd/Page: remove unused method Concat() 2017-02-19 20:13:19 +01:00
Max Kellermann
4162ce0bc5 output/httpd/Page: use uint8_t instead of unsigned char 2017-02-19 19:49:53 +01:00
Max Kellermann
7e46277016 Merge branch 'v0.20.x' 2017-02-19 19:46:18 +01:00
Max Kellermann
4bb83781e8 output/httpd/IcyMetaDataServer: cast length to unsigned
Fixes another buffer overflow: if the stream has a very long title or
URL, resulting in a metadata string of more than 2 kB, icy_string[0]
is a negative value, which gets casted to size_t - ouch!

 https://bugs.musicpd.org/view.php?id=4652
2017-02-19 19:28:52 +01:00
Max Kellermann
a73195b7cc output/httpd/IcyMetaDataServer: pad the string with 15 spaces
Fixes a buffer overflow due to the bad formula rounding the buffer
size up.  At the same time, remove the "+1" from the meta_length
calculation, which takes the padding into account and at the same time
implements proper rounding.
2017-02-19 19:27:37 +01:00
Max Kellermann
1bd00b8a9a output/httpd/IcyMetaDataServer: remove the int cast
Why did this cast exist??
2017-02-19 19:27:37 +01:00
Max Kellermann
47dffe66aa output/alsa: fix race condition on early snd_pcm_writei() error
During UnlockActivate() while the mutex is unlocked, the IOThread can
set a new error condition, and will never again wake up the
OutputThread.  This race condition can cause a deadlock in the
OutputThread.
2017-02-15 11:23:44 +01:00
Max Kellermann
4a80e9cb25 output/alsa: copy the PcmExport result to the ring_buffer
.. and not the input data.

Regression from commit b1c7649edb (integer underflow).

 https://bugs.musicpd.org/view.php?id=4639
2017-02-10 22:23:00 +01:00
Max Kellermann
cfd056231b output/alsa: use the EventLoop& parameter instead of io_thread_get() 2017-02-10 21:21:15 +01:00
Max Kellermann
b1c7649edb output/alsa: non-blocking mode
Use SND_PCM_NONBLOCK, and perform all snd_pcm_writei() calls in the
IOThread.  Use a lockless queue to copy data from the OutputThread to
the IOThread.

This rather major change aims to improve MPD's internal latency.  All
waits are now under MPD's control, instead of blocking inside
libasound2.

As a side effect, an output's filter is now decoupled from the actual
device I/O, which solves a major latency problem with the conversion
filter on slow CPUs and small period buffers.  See:

 https://bugs.musicpd.org/view.php?id=3900
2017-02-09 21:36:18 +01:00
Max Kellermann
03a97d87ea tag/Tag*: rename several source files 2017-02-08 08:49:42 +01:00
Max Kellermann
df4af2b550 release v0.20.4
-----BEGIN PGP SIGNATURE-----
 
 iQJEBAABCAAuFiEEA5IzWngIOJSkMBxDI26KWMbbRRIFAliSTDkQHG1heEBtdXNp
 Y3BkLm9yZwAKCRAjbopYxttFEsIQD/4iNkylzLp8mID2aFT690MFzv4TRXi2XS7v
 r3Rlx3hpGyDdzeXZeFc5zxsc9Ei8OfLcdFC/Umj9LjQanXakOxwsdhagrW9cadNX
 YLxkyVcREXalmzUvoWeRnya1LjoTdYA8llvG2tAJosXVr0o/GHZi56aHcrYnW2a6
 XD8kEk5k9beuEcBLk1rdZCTGPbVLwCFvMcpZ7j5Hd4kDGQjjw2aoEaPWchJdhLQh
 p+GRSU+A8hyTo9zy+aNO3cKvq6zqVxDLlHnIqh8XPWQoLPyWuD7ETvwERKmdmiPZ
 bSo0MR7azTlhkWbNZxjPHgZuacJDlwKvXPg1ofjn8VVcaVe5ONeX+1WP0ozUYqyU
 fmhLxMHKuwZcKo6do/jNhAVp//VBWhSwJHPA8kjBTuZHHc0HvgyTxlAgvzlrSswe
 dxc8vnvzgJfUKz5k7mf3amVg6Cu1CmNi59CkyL0NL+8N0inyMfdeQuQEYgbPoI6X
 jIRwACfXpMX75VtiDaNpnFLBjL5emE6u2bDoU2c5ezgpthaWjb0PqSmoLBBF8TNm
 k0ecXlIwCjT3pDcqmFdqgG3AJiYLTgX0rETC8PInl6toLzr2oVMVlijU3YK5PjMl
 nTvgs8TwprTWImgcBnidqRMb39p3AKs12pHfZ4Y5Iu82Bm60acZQMkv6sQh43Wyc
 +W2+T3D2IA==
 =b2Fz
 -----END PGP SIGNATURE-----

Merge tag 'v0.20.4'

release v0.20.4
2017-02-01 22:05:33 +01:00
Max Kellermann
38d263ac19 output/sndio: work around a libroar C++ incompatibility
Same as in commit e02d8ad8d2, but this time for the sndio plugin
which can be emulated by libroar.
2017-02-01 19:53:23 +01:00
Max Kellermann
8fd9d91974 output/Plugin: pass EventLoop& to init()
Eliminate dependency on io_thread_get().
2017-01-25 22:54:41 +01:00
Max Kellermann
d3f35dab1e output/ao: convert to class, make attributes private 2017-01-25 10:46:09 +01:00
Max Kellermann
487e2618cd output/ao: use AudioOutputWrapper 2017-01-25 10:45:20 +01:00
Max Kellermann
30d5186db4 output/ao: use const_cast instead of the union hack 2017-01-25 10:44:19 +01:00
Max Kellermann
cbe59714d4 output/solaris: convert to class, make attributes private 2017-01-25 10:33:38 +01:00
Max Kellermann
704a28ca17 output/solaris: use AudioOutputWrapper 2017-01-25 10:29:42 +01:00
Max Kellermann
8d70d10aba output/httpd: use AudioOutputWrapper 2017-01-25 10:05:08 +01:00
Max Kellermann
ddd8b16f2b output/roar: use AudioOutputWrapper::Init() 2017-01-25 10:05:08 +01:00
Max Kellermann
6b968beede output/alsa: convert to class, make attributes private 2017-01-24 23:08:16 +01:00
Max Kellermann
f68dd1bffb output/alsa: make AlsaSetup() an AlsaOutput method 2017-01-24 23:06:33 +01:00
Max Kellermann
f92b71ca99 output/alsa: move code from AlsaSetup() to AlsaSetupSw() 2017-01-24 23:05:29 +01:00
Max Kellermann
2b79fe2d6a output/alsa: move code from AlsaSetup() to AlsaSetupHw() 2017-01-24 22:48:48 +01:00
Max Kellermann
6eea56861b AUTHORS, ...: update my email address 2017-01-17 11:54:55 +01:00
Max Kellermann
4ad0747c78 output/alsa: explicitly mention all snd_pcm_state() enums
I want a compiler warning when a new state needs to be considered
here.
2017-01-14 20:49:15 +01:00
Max Kellermann
c7b0c46d9f output/recorder: fix typo in variable name
Fixes the dreaded error "Failed to create : No such file or
directory".

 https://bugs.musicpd.org/view.php?id=4625
2017-01-12 21:36:32 +01:00
Max Kellermann
df578c91ad output/alsa: log DoP mode 2017-01-11 22:50:40 +01:00
Max Kellermann
70008c47c9 output/alsa: support DSD_U16 2017-01-11 22:47:21 +01:00
Max Kellermann
8364029db8 output/alsa: move code to PlayRaw() 2017-01-11 21:38:05 +01:00
Max Kellermann
78a73eac53 pcm/Export: add (dummy) method Cancel()
We'll have some code for it soon.
2017-01-11 15:41:28 +01:00
Max Kellermann
9c4df66925 pcm/Export: halve the sample rate for DoP
Move this sample rate fixup from the ALSA output plugin to PcmExport,
where it belongs.
2017-01-11 10:33:23 +01:00
Max Kellermann
c143adba91 pcm/Export: add CalcOutputSampleRate(), CalcInputSampleRate()
Prepare for DSD sample rate fixups.
2017-01-10 23:48:26 +01:00
Max Kellermann
5900253b85 update copyright year 2017-01-03 20:48:59 +01:00
Max Kellermann
2e182e84c3 thread/Mutex: remove ScopeLock, use std::lock_guard directly 2017-01-03 07:11:57 +01:00
Max Kellermann
71e7d32b08 output/Timer: use std::chrono 2016-12-28 22:00:33 +01:00
Max Kellermann
d5e422970c output/Plugin: delay() returns std::chrono::steady_clock::duration 2016-12-28 22:00:29 +01:00
Max Kellermann
35a2a48c47 Merge branch 'v0.19.x' 2016-11-17 22:20:24 +01:00
Max Kellermann
5c3e55b5b1 {input,output}/alsa: fix gcc 7.0 -Wimplicit-fallthrough 2016-11-16 19:50:38 +01:00
Dave Hocker
f6a85f0b0b output/osx: fix build failure 2016-11-10 12:55:08 +01:00
Max Kellermann
d9cb85df83 output/Plugin: remove 'Error&' parameters, use C++ exceptions only 2016-11-09 12:36:21 +01:00
Max Kellermann
bbe7a37359 output/Internal: hide Configure() and remove the non-configuring constructor 2016-11-09 12:06:06 +01:00