From 1c60c8e014c847862d5ba536e396cdf1edf19cad Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Mon, 12 Nov 2018 12:05:54 +0100 Subject: [PATCH] output/Filtered: catch Drain() exceptions in CloseOutput() --- src/output/Filtered.cxx | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/output/Filtered.cxx b/src/output/Filtered.cxx index 43c9ef114..6a0fedb49 100644 --- a/src/output/Filtered.cxx +++ b/src/output/Filtered.cxx @@ -124,9 +124,14 @@ FilteredAudioOutput::OpenOutputAndConvert(AudioFormat desired_audio_format) void FilteredAudioOutput::CloseOutput(bool drain) noexcept { - if (drain) - Drain(); - else + if (drain) { + try { + Drain(); + } catch (...) { + FormatError(std::current_exception(), + "Failed to drain %s", GetLogName()); + } + } else Cancel(); output->Close();