early-access version 3170
This commit is contained in:
@@ -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"
|
||||
|
@@ -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();
|
||||
|
@@ -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;
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user