From ceef334c1cc2c55def468a1f83474ba8d4a3884d Mon Sep 17 00:00:00 2001 From: David Marcec Date: Sun, 7 Oct 2018 14:25:39 +1100 Subject: [PATCH] Fixups for softlock --- src/audio_core/audio_renderer.cpp | 11 ++++++----- src/audio_core/audio_renderer.h | 2 +- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/audio_core/audio_renderer.cpp b/src/audio_core/audio_renderer.cpp index 5d2feb1b97..23e5d3f100 100644 --- a/src/audio_core/audio_renderer.cpp +++ b/src/audio_core/audio_renderer.cpp @@ -30,7 +30,7 @@ public: return info; } - VoiceInfo& Info() { + VoiceInfo& GetInfo() { return info; } @@ -61,7 +61,7 @@ public: return info; } - EffectInStatus& Info() { + EffectInStatus& GetInfo() { return info; } @@ -120,7 +120,7 @@ std::vector AudioRenderer::UpdateAudioRenderer(const std::vector& input_ std::size_t voice_offset{sizeof(UpdateDataHeader) + config.behavior_size + config.memory_pools_size + config.voice_resource_size}; for (auto& voice : voices) { - std::memcpy(&voice.Info(), input_params.data() + voice_offset, sizeof(VoiceInfo)); + std::memcpy(&voice.GetInfo(), input_params.data() + voice_offset, sizeof(VoiceInfo)); voice_offset += sizeof(VoiceInfo); } @@ -128,7 +128,7 @@ std::vector AudioRenderer::UpdateAudioRenderer(const std::vector& input_ config.memory_pools_size + config.voice_resource_size + config.voices_size}; for (auto& effect : effects) { - std::memcpy(&effect.Info(), input_params.data() + effect_offset, sizeof(EffectInStatus)); + std::memcpy(&effect.GetInfo(), input_params.data() + effect_offset, sizeof(EffectInStatus)); effect_offset += sizeof(EffectInStatus); } @@ -285,7 +285,8 @@ void AudioRenderer::VoiceState::RefreshBuffer() { break; } - samples = Interpolate(interp_state, std::move(samples), Info().sample_rate, STREAM_SAMPLE_RATE); + samples = + Interpolate(interp_state, std::move(samples), GetInfo().sample_rate, STREAM_SAMPLE_RATE); is_refresh_pending = false; } diff --git a/src/audio_core/audio_renderer.h b/src/audio_core/audio_renderer.h index a2caeb118b..4662c87225 100644 --- a/src/audio_core/audio_renderer.h +++ b/src/audio_core/audio_renderer.h @@ -220,8 +220,8 @@ public: Stream::State GetStreamState() const; private: - class VoiceState; class EffectState; + class VoiceState; AudioRendererParameter worker_params; Kernel::SharedPtr buffer_event;