diff options
author | Kelebek1 <eeeedddccc@hotmail.co.uk> | 2022-08-01 03:58:13 +0200 |
---|---|---|
committer | Kelebek1 <eeeedddccc@hotmail.co.uk> | 2022-09-02 05:43:04 +0200 |
commit | ea9ff71725113b8dbb159917c57aa536bba0cb53 (patch) | |
tree | 512cce0fea5eb511aa7803bc67f741815885bfcb /src/audio_core/renderer/system_manager.cpp | |
parent | Merge pull request #8752 from vonchenplus/rectangle_texture (diff) | |
download | yuzu-ea9ff71725113b8dbb159917c57aa536bba0cb53.tar yuzu-ea9ff71725113b8dbb159917c57aa536bba0cb53.tar.gz yuzu-ea9ff71725113b8dbb159917c57aa536bba0cb53.tar.bz2 yuzu-ea9ff71725113b8dbb159917c57aa536bba0cb53.tar.lz yuzu-ea9ff71725113b8dbb159917c57aa536bba0cb53.tar.xz yuzu-ea9ff71725113b8dbb159917c57aa536bba0cb53.tar.zst yuzu-ea9ff71725113b8dbb159917c57aa536bba0cb53.zip |
Diffstat (limited to 'src/audio_core/renderer/system_manager.cpp')
-rw-r--r-- | src/audio_core/renderer/system_manager.cpp | 35 |
1 files changed, 4 insertions, 31 deletions
diff --git a/src/audio_core/renderer/system_manager.cpp b/src/audio_core/renderer/system_manager.cpp index b326819ed..bc2dd9e6e 100644 --- a/src/audio_core/renderer/system_manager.cpp +++ b/src/audio_core/renderer/system_manager.cpp @@ -15,8 +15,7 @@ MICROPROFILE_DEFINE(Audio_RenderSystemManager, "Audio", "Render System Manager", MP_RGB(60, 19, 97)); namespace AudioCore::AudioRenderer { -constexpr std::chrono::nanoseconds BaseRenderTime{5'000'000UL}; -constexpr std::chrono::nanoseconds RenderTimeOffset{400'000UL}; +constexpr std::chrono::nanoseconds RENDER_TIME{5'000'000UL}; SystemManager::SystemManager(Core::System& core_) : core{core_}, adsp{core.AudioCore().GetADSP()}, mailbox{adsp.GetRenderMailbox()}, @@ -36,8 +35,8 @@ bool SystemManager::InitializeUnsafe() { if (adsp.Start()) { active = true; thread = std::jthread([this](std::stop_token stop_token) { ThreadFunc(); }); - core.CoreTiming().ScheduleLoopingEvent(std::chrono::nanoseconds(0), - BaseRenderTime - RenderTimeOffset, thread_event); + core.CoreTiming().ScheduleLoopingEvent(std::chrono::nanoseconds(0), RENDER_TIME, + thread_event); } } @@ -121,35 +120,9 @@ void SystemManager::ThreadFunc() { } std::optional<std::chrono::nanoseconds> SystemManager::ThreadFunc2(s64 time) { - std::optional<std::chrono::nanoseconds> new_schedule_time{std::nullopt}; - const auto queue_size{core.AudioCore().GetStreamQueue()}; - switch (state) { - case StreamState::Filling: - if (queue_size >= 5) { - new_schedule_time = BaseRenderTime; - state = StreamState::Steady; - } - break; - case StreamState::Steady: - if (queue_size <= 2) { - new_schedule_time = BaseRenderTime - RenderTimeOffset; - state = StreamState::Filling; - } else if (queue_size > 5) { - new_schedule_time = BaseRenderTime + RenderTimeOffset; - state = StreamState::Draining; - } - break; - case StreamState::Draining: - if (queue_size <= 5) { - new_schedule_time = BaseRenderTime; - state = StreamState::Steady; - } - break; - } - update.store(true); update.notify_all(); - return new_schedule_time; + return std::nullopt; } void SystemManager::PauseCallback(bool paused) { |