output/Filtered: catch Drain() exceptions in CloseOutput()

This commit is contained in:
Max Kellermann 2018-11-12 12:05:54 +01:00
parent eddda95900
commit 1c60c8e014

View File

@ -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();