early-access version 3158
This commit is contained in:
@@ -266,19 +266,18 @@ void SinkStream::ProcessAudioOutAndRender(std::span<s16> output_buffer, std::siz
|
||||
}
|
||||
|
||||
void SinkStream::Stall() {
|
||||
if (stalled) {
|
||||
if (IsStalled()) {
|
||||
return;
|
||||
}
|
||||
stalled = true;
|
||||
system.StallProcesses();
|
||||
stalled_lock = system.StallProcesses();
|
||||
}
|
||||
|
||||
void SinkStream::Unstall() {
|
||||
if (!stalled) {
|
||||
if (!IsStalled()) {
|
||||
return;
|
||||
}
|
||||
system.UnstallProcesses();
|
||||
stalled = false;
|
||||
stalled_lock.unlock();
|
||||
}
|
||||
|
||||
} // namespace AudioCore::Sink
|
||||
|
@@ -6,6 +6,7 @@
|
||||
#include <array>
|
||||
#include <atomic>
|
||||
#include <memory>
|
||||
#include <mutex>
|
||||
#include <span>
|
||||
#include <vector>
|
||||
|
||||
@@ -209,6 +210,11 @@ public:
|
||||
*/
|
||||
void Unstall();
|
||||
|
||||
private:
|
||||
[[nodiscard]] bool IsStalled() const {
|
||||
return stalled_lock.owns_lock();
|
||||
}
|
||||
|
||||
protected:
|
||||
/// Core system
|
||||
Core::System& system;
|
||||
@@ -241,7 +247,7 @@ private:
|
||||
/// Set via IAudioDevice service calls
|
||||
f32 device_volume{1.0f};
|
||||
/// True if coretiming has been stalled
|
||||
bool stalled{false};
|
||||
std::unique_lock<std::mutex> stalled_lock;
|
||||
};
|
||||
|
||||
using SinkStreamPtr = std::unique_ptr<SinkStream>;
|
||||
|
Reference in New Issue
Block a user