From 11b8336d3ed24ac2f36abce53b0c269838c84e0d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gonzalo=20Garramu=C3=B1o?= Date: Mon, 25 Sep 2023 15:19:59 -0300 Subject: [PATCH] Added some more audio checks. --- lib/tlTimeline/Player.cpp | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/lib/tlTimeline/Player.cpp b/lib/tlTimeline/Player.cpp index c2a6e915c..6481b3e84 100644 --- a/lib/tlTimeline/Player.cpp +++ b/lib/tlTimeline/Player.cpp @@ -124,7 +124,21 @@ namespace tl p.mutex.cacheInfo = p.cacheInfo->get(); p.audioMutex.speed = p.speed->get(); #if defined(TLRENDER_AUDIO) - p.thread.rtAudio.reset(new RtAudio); + try + { + p.thread.rtAudio.reset(new RtAudio); + } + catch (const std::exception& e) + { + std::stringstream ss; + ss << "Cannot open create RtAudio instance: " << e.what(); + context->log("tl::timeline::Player", ss.str(), log::Type::Error); + } + if (!p.thread.rtAudio) + { + p.thread.running = false; + return; + } #endif p.thread.running = true; p.thread.thread = std::thread(