diff --git a/Sources/CSFBAudioEngine/Player/AudioPlayer.mm b/Sources/CSFBAudioEngine/Player/AudioPlayer.mm index 41288a14..96f2dc64 100644 --- a/Sources/CSFBAudioEngine/Player/AudioPlayer.mm +++ b/Sources/CSFBAudioEngine/Player/AudioPlayer.mm @@ -577,7 +577,7 @@ Flags clearFlags(Flags flags, std::memory_order order = std::memory_order_acq_re // Register a stop callback for the decoding thread std::stop_callback decodingThreadStopCallback(decodingThread_.get_stop_token(), - [this] { decodingSemaphore_.signal(); }); + [this]() noexcept { decodingSemaphore_.signal(); }); // Issue a stop request to the decoding thread and wait for it to exit decodingThread_.request_stop(); @@ -588,7 +588,8 @@ Flags clearFlags(Flags flags, std::memory_order order = std::memory_order_acq_re } // Register a stop callback for the event processing thread - std::stop_callback eventThreadStopCallback(eventThread_.get_stop_token(), [this] { eventSemaphore_.signal(); }); + std::stop_callback eventThreadStopCallback(eventThread_.get_stop_token(), + [this]() noexcept { eventSemaphore_.signal(); }); // Issue a stop request to the event processing thread and wait for it to exit eventThread_.request_stop(); @@ -1303,7 +1304,7 @@ Flags clearFlags(Flags flags, std::memory_order order = std::memory_order_acq_re { std::lock_guard lock{activeDecodersMutex_}; - const auto iter = std::ranges::find_if(activeDecoders_, [](const auto &decoderState) { + const auto iter = std::ranges::find_if(activeDecoders_, [](const auto &decoderState) noexcept { const auto flags = decoderState->loadFlags(); return bits::has_none(flags, DecoderState::Flags::isCanceled | DecoderState::Flags::decodingComplete); }); @@ -1413,7 +1414,7 @@ Flags clearFlags(Flags flags, std::memory_order order = std::memory_order_acq_re // If there is a format mismatch the processing graph requires reconfiguration before decoding can begin if (formatMismatch) { // Wait until all other decoders complete processing before reconfiguring the graph - const auto okToReconfigure = [&] { + const auto okToReconfigure = [&]() noexcept { std::lock_guard lock{activeDecodersMutex_}; return activeDecoders_.size() == 1; }(); @@ -1846,7 +1847,7 @@ Flags clearFlags(Flags flags, std::memory_order order = std::memory_order_acq_re } } - const auto hasNoDecoders = [&] { + const auto hasNoDecoders = [&]() noexcept { std::scoped_lock lock{queuedDecodersMutex_, activeDecodersMutex_}; return queuedDecoders_.empty() && activeDecoders_.empty(); }(); @@ -2164,7 +2165,7 @@ Flags clearFlags(Flags flags, std::memory_order order = std::memory_order_acq_re [delegate audioPlayer:player renderingComplete:decoder]; } - const auto hasNoDecoders = [&] { + const auto hasNoDecoders = [&]() noexcept { std::scoped_lock lock{that->queuedDecodersMutex_, that->activeDecodersMutex_}; return that->queuedDecoders_.empty() && that->activeDecoders_.empty(); }(); @@ -2227,7 +2228,7 @@ Flags clearFlags(Flags flags, std::memory_order order = std::memory_order_acq_re activeDecodersMutex_.assertIsOwner(); #endif /* DEBUG */ - const auto iter = std::ranges::find_if(activeDecoders_, [](const auto &decoderState) { + const auto iter = std::ranges::find_if(activeDecoders_, [](const auto &decoderState) noexcept { const auto flags = decoderState->loadFlags(); return bits::has_none(flags, DecoderState::Flags::needsInitialization | DecoderState::Flags::isCanceled); }); diff --git a/Sources/CSFBAudioEngine/Player/host_time.hpp b/Sources/CSFBAudioEngine/Player/host_time.hpp index 5fa3af41..5290498f 100644 --- a/Sources/CSFBAudioEngine/Player/host_time.hpp +++ b/Sources/CSFBAudioEngine/Player/host_time.hpp @@ -20,7 +20,7 @@ namespace detail { // On Apple Silicon it is 125/3. /// A fraction used to convert host ticks to nanoseconds. -inline const auto timebase = [] noexcept { +inline const auto timebase = []() noexcept { // If `mach_timebase_info()` doesn't succeed there is no way to convert to/from host times. // Luckily the function seems to only return `KERN_SUCCESS`: // https://github.com/apple-oss-distributions/xnu/blob/main/libsyscall/wrappers/mach_timebase_info.c#L29