summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/output/Thread.cxx8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/output/Thread.cxx b/src/output/Thread.cxx
index 3fb17ae54..fe358ce2f 100644
--- a/src/output/Thread.cxx
+++ b/src/output/Thread.cxx
@@ -379,11 +379,11 @@ PlayFull(FilteredAudioOutput &output, ConstBuffer<void> _buffer)
inline void
AudioOutputControl::InternalDrain() noexcept
{
- const ScopeUnlock unlock(mutex);
-
try {
/* flush the filter and play its remaining output */
+ const ScopeUnlock unlock(mutex);
+
while (true) {
auto buffer = source.Flush();
if (buffer.IsNull())
@@ -391,14 +391,14 @@ AudioOutputControl::InternalDrain() noexcept
PlayFull(*output, buffer);
}
+
+ output->Drain();
} catch (...) {
FormatError(std::current_exception(),
"Failed to flush filter on %s", GetLogName());
InternalCloseError(std::current_exception());
return;
}
-
- output->Drain();
}
void