Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 8 additions & 7 deletions Sources/CSFBAudioEngine/Player/AudioPlayer.mm
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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();
Expand Down Expand Up @@ -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);
});
Expand Down Expand Up @@ -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;
}();
Expand Down Expand Up @@ -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();
}();
Expand Down Expand Up @@ -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();
}();
Expand Down Expand Up @@ -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);
});
Expand Down
2 changes: 1 addition & 1 deletion Sources/CSFBAudioEngine/Player/host_time.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down