summaryrefslogtreecommitdiff
path: root/src/output
diff options
context:
space:
mode:
authorMax Kellermann <max@musicpd.org>2017-11-14 21:06:17 +0100
committerMax Kellermann <max@musicpd.org>2017-11-14 21:08:07 +0100
commit7d579e7400069d116628da38ff3026670fe53611 (patch)
tree80056efdf247cf756cbaa1d1974e4af52d743e8a /src/output
parente0f777d4eb2ae6a96f8182db3652c8a913f5a957 (diff)
lib/alsa/NonBlock: throw exception on error
Avoid another potential deadlock: if no file descriptors are registered, our non-blocking ALSA code cannot ever work.
Diffstat (limited to 'src/output')
-rw-r--r--src/output/plugins/AlsaOutputPlugin.cxx8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/output/plugins/AlsaOutputPlugin.cxx b/src/output/plugins/AlsaOutputPlugin.cxx
index c7dda9e9a..8a7acee95 100644
--- a/src/output/plugins/AlsaOutputPlugin.cxx
+++ b/src/output/plugins/AlsaOutputPlugin.cxx
@@ -815,7 +815,13 @@ AlsaOutput::PrepareSockets() noexcept
return std::chrono::steady_clock::duration(-1);
}
- return PrepareAlsaPcmSockets(*this, pcm, pfd_buffer);
+ try {
+ return PrepareAlsaPcmSockets(*this, pcm, pfd_buffer);
+ } catch (...) {
+ ClearSocketList();
+ LockCaughtError();
+ return std::chrono::steady_clock::duration(-1);
+ }
}
void