early-access version 3170

This commit is contained in:
pineappleEA
2022-11-30 18:07:45 +01:00
parent bc8c8445f6
commit 16cad67595
19 changed files with 33 additions and 99 deletions

View File

@@ -3,10 +3,4 @@
#pragma once
#include <algorithm>
#include <chrono>
#include <memory>
#include <fmt/format.h>
#include "common/assert.h"
#include "common/common_headers.h"

View File

@@ -266,14 +266,16 @@ void SinkStream::ProcessAudioOutAndRender(std::span<s16> output_buffer, std::siz
}
void SinkStream::Stall() {
if (IsStalled()) {
std::scoped_lock lk{stall_guard};
if (stalled_lock) {
return;
}
stalled_lock = system.StallProcesses();
}
void SinkStream::Unstall() {
if (!IsStalled()) {
std::scoped_lock lk{stall_guard};
if (!stalled_lock) {
return;
}
system.UnstallProcesses();

View File

@@ -210,11 +210,6 @@ public:
*/
void Unstall();
private:
[[nodiscard]] bool IsStalled() const {
return stalled_lock.owns_lock();
}
protected:
/// Core system
Core::System& system;
@@ -246,7 +241,7 @@ private:
f32 system_volume{1.0f};
/// Set via IAudioDevice service calls
f32 device_volume{1.0f};
/// True if coretiming has been stalled
std::mutex stall_guard;
std::unique_lock<std::mutex> stalled_lock;
};