Max Kellermann
febd1ad09c
output/alsa: fix deadlock bug
...
After UnlockActivate() returns, we not only need to check for errors,
but also for more room in the ring buffer. If we don't check the ring
buffer, it may be drained already, and the cond.wait() call will never
finish.
Closes #151
2017-11-14 21:02:53 +01:00
Max Kellermann
1040b85785
lib/{curl,upnp}: add more exception handlers
...
Bugs found by Coverity.
2017-11-14 20:05:44 +01:00
Max Kellermann
e2c81aa9ea
Merge branch 'v0.20.x'
2017-11-14 12:31:13 +01:00
Max Kellermann
014f8cd693
output/httpd: flush encoder after tag
...
Without the flush, ReadPage() may not return any data, or not all
data. This may result in incomplete ddata the new "header" page,
corrupting streams with some encoders such as Vorbis.
Fixes #145
2017-11-14 12:00:14 +01:00
Max Kellermann
aea37e46e3
encoder/vorbis: default to quality 3
...
Don't require a quality or bitrate setting. If nothing is set, don't
fail startup - just go with a good default. A quality setting of 3 is
what "oggenc" defaults to as well.
2017-11-14 11:30:28 +01:00
Max Kellermann
31ab78ae8e
input/{cdio,ffmpeg,file,smbclient}: unlock the mutex during blocking I/O
...
InputStream::Read() and InputStream::Seek() are called with the mutex
locked. That means the implementation must not block, or unlock the
mutex before calling into blocking code.
Previously, a slow CD drive could stall the whole MPD process,
including the main thread, due to this problem.
Closes #149
2017-11-13 17:13:10 +01:00
Max Kellermann
f82e1453e4
input/smbclient: use std::lock_guard
2017-11-13 17:13:10 +01:00
Max Kellermann
e4a147218b
Merge branch 'v0.20.x'
2017-11-12 18:55:12 +01:00
Max Kellermann
a2b77c8813
decoder/ffmpeg, test/test_protocol: catch exceptions by reference
...
Work around -Werror=catch-value.
2017-11-12 18:54:29 +01:00
Max Kellermann
18add29472
configure.ac: disable -Wnoexcept-type
...
Workaround for #146 .
2017-11-12 18:54:29 +01:00
Max Kellermann
4b2b89eb5e
lib/xiph: add "noexcept"
2017-11-12 18:35:49 +01:00
Max Kellermann
4b2bb88375
lib/upnp: add "noexcept"
2017-11-12 18:33:58 +01:00
Max Kellermann
fb01e41e8a
lib/sqlite: add "noexcept"
2017-11-12 18:26:03 +01:00
Max Kellermann
ff9759c09d
lib/pulse: add "noexcept"
2017-11-12 18:25:16 +01:00
Max Kellermann
a92e0e8540
lib/nfs: add "noexcept"
2017-11-12 18:09:07 +01:00
Max Kellermann
9d47b220a4
lib/curl: add "noexcept"
2017-11-12 17:49:58 +01:00
Max Kellermann
c582a9faae
event/MultiSocketMonitor: add "noexcept"
2017-11-12 17:42:50 +01:00
Max Kellermann
cf483107c9
event/IdleMonitor: add "noexcept"
2017-11-12 17:40:25 +01:00
Max Kellermann
b57e2f5521
event/DeferredMonitor: eliminate obsolete class
...
Move its code to DeferEvent instead.
2017-11-12 17:34:06 +01:00
Max Kellermann
bf3ced6a34
event/Call: migrate from DeferredMonitor to DeferEvent
2017-11-12 17:32:23 +01:00
Max Kellermann
390e830994
{mixer,output}/alsa: migrate from DeferredMonitor to DeferEvent
2017-11-12 17:27:58 +01:00
Max Kellermann
44c60567dd
output/alsa: add "allowed_formats" setting
...
Allows defining a list of supported audio formats, and allows
switching on and off DoP with certain formats.
This is a first rough draft. The setting syntax and its semantics may
still be redesigned.
2017-11-10 23:05:50 +01:00
Max Kellermann
967d81b782
AudioFormat: add method MatchMask()
2017-11-10 23:05:50 +01:00
Max Kellermann
20199e770c
output/shout: use the shout_metadata_t only once
...
There is no documentation on whether calling shout_metadata_add()
multiple times on one instance is allowed. To be sure, let's allocate
the object on demand each time in SendTag().
2017-11-10 22:30:53 +01:00
Max Kellermann
4c824e5309
output/shout: simplify shout_tag_to_metadata()
2017-11-10 22:26:25 +01:00
Max Kellermann
981bc85879
output/shout: relax quality and bitrate checks, forward as-is
2017-11-10 22:19:00 +01:00
Max Kellermann
015527d870
output/shout: make "quality" and "bitrate" local variables
2017-11-10 22:17:51 +01:00
Max Kellermann
6464b4b372
encoder/Configured: glue code to initialize PreparedEncoder
2017-11-10 21:54:57 +01:00
Max Kellermann
fef9747fbf
output/shout: use MIME type instead of the encoder plugin name
...
This is more robust, for example it allows using the Shine encoder
plugin instead of LAME.
2017-11-10 21:52:54 +01:00
Max Kellermann
13816c1c7d
output/{recorder,httpd,shout}: use std::unique_ptr to manage PreparedEncoder pointer
2017-11-10 21:35:22 +01:00
Max Kellermann
c54a920d13
output/httpd: make enum strictly-typed
2017-11-10 21:25:03 +01:00
Max Kellermann
83f8eeec44
output/httpd: migrate from DeferredMonitor to DeferEvent
2017-11-10 21:18:00 +01:00
Max Kellermann
b83fbad6a1
output/httpd: use C++11 initializers
2017-11-10 21:15:57 +01:00
Max Kellermann
ec20784046
storage/curl: migrate from DeferredMonitor to DeferEvent
2017-11-10 21:10:54 +01:00
Max Kellermann
42ad753e39
event/MaskMonitor: migrate from DeferredMonitor to DeferEvent
2017-11-10 21:10:46 +01:00
Max Kellermann
1ccd2a7b11
lib/nfs: migrate from DeferredMonitor to DeferEvent
2017-11-10 21:06:40 +01:00
Max Kellermann
4c1d29c86c
lib/nfs/FileReader: use C++11 initializers
2017-11-10 21:03:41 +01:00
Max Kellermann
0db7a0c9e2
db/update/Service: migrate from DeferredMonitor to DeferEvent
2017-11-10 20:58:25 +01:00
Max Kellermann
13f6b1b344
db/update/Remove: migrate from DeferredMonitor to DeferEvent
2017-11-10 20:56:21 +01:00
Max Kellermann
593d82c6a9
event/DeferEvent: add "noexcept"
2017-11-10 20:55:24 +01:00
Max Kellermann
43dccbd45d
event/SocketMonitor: remove unused method Abandon()
2017-11-10 20:52:37 +01:00
Max Kellermann
0ff4350352
event/ServerSocket: pass UniqueSocketDescriptor by value
...
Passing it by value is actually smaller (32 bit) than the rvalue
reference (64 bit pointer), and it ensures that the object is consumed
after the call returns, no matter how the methods are implemented.
2017-11-10 20:43:14 +01:00
Max Kellermann
5fd2b7cc79
event/SocketMonitor: eliminate Read(), Write()
...
Migrate callers to GetSocket().Read(), GetSocket.Write(), which is the
same.
2017-11-10 20:37:52 +01:00
Max Kellermann
7e16ac305d
event/SocketMonitor: rename Get() to GetSocket()
2017-11-10 20:34:45 +01:00
Max Kellermann
59a8836924
event/SocketMonitor: add "noexcept"
2017-11-10 20:20:07 +01:00
Max Kellermann
9d4020501c
event/SocketMonitor: make constructor "explicit"
2017-11-10 20:17:27 +01:00
Max Kellermann
81350d65bc
event/SocketMonitor: use C++11 initializers
2017-11-10 20:16:26 +01:00
Max Kellermann
02642a64fd
input/Plugin: remove "#undef ERROR"
...
Maybe this was once a required kludge for Windows, but it's not
anymore.
2017-11-10 19:59:03 +01:00
Max Kellermann
3c41e9f022
evnet/SocketMonitor: move WIN32/ERROR comment to PollGroupWinSelect.hxx
2017-11-10 19:57:54 +01:00
Max Kellermann
2670e13cbd
util/{Const,Writable}Buffer: add static_assert to FromVoid()
2017-11-10 19:43:17 +01:00