From 6f0e5df5a27c690d36708477fbdc871a290fc80b Mon Sep 17 00:00:00 2001 From: 16-Bit-Dog <67922228+16-Bit-Dog@users.noreply.github.com> Date: Wed, 27 Jan 2021 08:19:38 -0500 Subject: [PATCH] clang auto format followed I think... just moved the code to VS to see if it auto formatted --- src/audio_core/audio_renderer.cpp | 41 ++++++++++++++----------------- 1 file changed, 18 insertions(+), 23 deletions(-) diff --git a/src/audio_core/audio_renderer.cpp b/src/audio_core/audio_renderer.cpp index 28469e216d..7b038d0eec 100644 --- a/src/audio_core/audio_renderer.cpp +++ b/src/audio_core/audio_renderer.cpp @@ -2,9 +2,9 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. +#include #include #include -#include #include "audio_core/audio_out.h" #include "audio_core/audio_renderer.h" @@ -70,10 +70,10 @@ namespace { namespace AudioCore { -std::vector > queueMixedThreadFence; +std::vector> queueMixedThreadFence; std::future keepThreadReady1; std::future keepThreadReady2; - + AudioRenderer::AudioRenderer(Core::Timing::CoreTiming& core_timing, Core::Memory::Memory& memory_, AudioCommon::AudioRendererParameter params, Stream::ReleaseCallback&& release_callback, @@ -201,9 +201,7 @@ ResultCode AudioRenderer::UpdateAudioRenderer(const std::vector& input_param return AudioCommon::Audren::ERR_INVALID_PARAMETERS; } - keepThreadReady1 = std::async(std::launch::async, [&] { - ReleaseAndQueueBuffers(); - }); + keepThreadReady1 = std::async(std::launch::async, [&] { ReleaseAndQueueBuffers(); }); keepThreadReady1.get(); @@ -219,17 +217,17 @@ void AudioRenderer::QueueMixedBuffer(Buffer::Tag tag) { if (!splitter_context.UsingSplitter()) { mix_context.SortInfo(); } - - queueMixedThreadFence.push_back(std::async(std::launch::async, [&] { - // Sort our voices - voice_context.SortInfo(); - // Handle samples - command_generator.GenerateVoiceCommands(); - command_generator.GenerateSubMixCommands(); - command_generator.GenerateFinalMixCommands(); + queueMixedThreadFence.push_back(std::async(std::launch::async, [&] { + // Sort our voices + voice_context.SortInfo(); - command_generator.PostCommand(); + // Handle samples + command_generator.GenerateVoiceCommands(); + command_generator.GenerateSubMixCommands(); + command_generator.GenerateFinalMixCommands(); + + command_generator.PostCommand(); })); // Base sample size @@ -328,20 +326,17 @@ void AudioRenderer::QueueMixedBuffer(Buffer::Tag tag) { elapsed_frame_count++; voice_context.UpdateStateByDspShared(); } - void AudioRenderer::ReleaseAndQueueBuffers() { const auto released_buffers{audio_out->GetTagsAndReleaseBuffers(stream)}; - - queueMixedThreadFence.resize(0); //instead of passing a s16 to the queue mixed buffer to control, pushing values to a vector seemed about as fast - + + queueMixedThreadFence.resize(0); // instead of passing a s16 to the queue mixed buffer to + // control, pushing values to a vector seemed about as fast + for (const auto& tag : released_buffers) { - keepThreadReady2 = std::async(std::launch::async, [&]{ - QueueMixedBuffer(tag); - }); + keepThreadReady2 = std::async(std::launch::async, [&] { QueueMixedBuffer(tag); }); keepThreadReady2.get(); } - } } // namespace AudioCore