From 55e6629fb49187f90e3c8357cee16ab393f5667d Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Mon, 30 Oct 2017 08:39:44 +0100 Subject: [PATCH] output/Control: catch and log StartThread() exceptions --- src/output/Control.cxx | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/output/Control.cxx b/src/output/Control.cxx index 2690f99c8..211044e57 100644 --- a/src/output/Control.cxx +++ b/src/output/Control.cxx @@ -190,8 +190,14 @@ AudioOutputControl::Open(const AudioFormat audio_format, request.audio_format = audio_format; request.pipe = ∓ - if (!thread.IsDefined()) - StartThread(); + if (!thread.IsDefined()) { + try { + StartThread(); + } catch (...) { + LogError(std::current_exception()); + return false; + } + } CommandWait(Command::OPEN); const bool open2 = open;