diff options
| author | Kelebek1 <eeeedddccc@hotmail.co.uk> | 2022-08-01 02:58:13 +0100 |
|---|---|---|
| committer | Kelebek1 <eeeedddccc@hotmail.co.uk> | 2022-09-02 04:43:04 +0100 |
| commit | ea9ff71725113b8dbb159917c57aa536bba0cb53 (patch) | |
| tree | 512cce0fea5eb511aa7803bc67f741815885bfcb /src/audio_core/renderer/behavior | |
| parent | a83a5d2e4c8932df864dd4cea2b04d87a12c8760 (diff) | |
Rework audio output, connecting AudioOut into coretiming to fix desync during heavy loads.
Diffstat (limited to 'src/audio_core/renderer/behavior')
| -rw-r--r-- | src/audio_core/renderer/behavior/behavior_info.cpp | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/audio_core/renderer/behavior/behavior_info.cpp b/src/audio_core/renderer/behavior/behavior_info.cpp index c5d4d66d8..92140aaea 100644 --- a/src/audio_core/renderer/behavior/behavior_info.cpp +++ b/src/audio_core/renderer/behavior/behavior_info.cpp @@ -43,13 +43,15 @@ void BehaviorInfo::AppendError(ErrorInfo& error) { } void BehaviorInfo::CopyErrorInfo(std::span<ErrorInfo> out_errors, u32& out_count) { - auto error_count_{std::min(error_count, MaxErrors)}; - std::memset(out_errors.data(), 0, MaxErrors * sizeof(ErrorInfo)); - - for (size_t i = 0; i < error_count_; i++) { - out_errors[i] = errors[i]; + out_count = std::min(error_count, MaxErrors); + + for (size_t i = 0; i < MaxErrors; i++) { + if (i < out_count) { + out_errors[i] = errors[i]; + } else { + out_errors[i] = {}; + } } - out_count = error_count_; } void BehaviorInfo::UpdateFlags(const Flags flags_) { |
