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 void
FilteredAudioOutput::CloseOutput(bool drain) noexcept FilteredAudioOutput::CloseOutput(bool drain) noexcept
{ {
if (drain) if (drain) {
try {
Drain(); Drain();
else } catch (...) {
FormatError(std::current_exception(),
"Failed to drain %s", GetLogName());
}
} else
Cancel(); Cancel();
output->Close(); output->Close();