output/alsa: rethrow errors in Drain()

This commit is contained in:
Max Kellermann 2018-04-26 16:17:14 +02:00
parent a6e5873443
commit 5dfdc15f93
1 changed files with 8 additions and 1 deletions

View File

@ -762,12 +762,19 @@ AlsaOutput::Drain()
{
const std::lock_guard<Mutex> lock(mutex);
if (error)
std::rethrow_exception(error);
drain = true;
UnlockActivate();
while (drain && !error)
while (drain) {
if (error)
std::rethrow_exception(error);
cond.wait(mutex);
}
}
inline void