From 5dfdc15f932c52d499d1938a4a5e063a1d9ff3ce Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Thu, 26 Apr 2018 16:17:14 +0200 Subject: [PATCH] output/alsa: rethrow errors in Drain() --- src/output/plugins/AlsaOutputPlugin.cxx | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/output/plugins/AlsaOutputPlugin.cxx b/src/output/plugins/AlsaOutputPlugin.cxx index b38fd36c0..2f51ef8d5 100644 --- a/src/output/plugins/AlsaOutputPlugin.cxx +++ b/src/output/plugins/AlsaOutputPlugin.cxx @@ -762,12 +762,19 @@ AlsaOutput::Drain() { const std::lock_guard 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