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.
This commit is contained in:
Max Kellermann
2017-11-14 21:06:17 +01:00
parent e0f777d4eb
commit 7d579e7400
3 changed files with 24 additions and 7 deletions

View File

@@ -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