diff options
author | liamwhite <liamwhite@users.noreply.github.com> | 2022-12-17 16:21:19 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-12-17 16:21:19 +0100 |
commit | fa10374d39effc79b5b9ed789bf873030cb08d7f (patch) | |
tree | 0e4cac7d6e87771e8f18c0d3bba7d8e3cddbb2c7 /src/audio_core/out | |
parent | Merge pull request #9457 from Kelebek1/silence_tfb (diff) | |
parent | Signal buffer event on audio in/out system stop, and force remove all registered audio buffers (diff) | |
download | yuzu-fa10374d39effc79b5b9ed789bf873030cb08d7f.tar yuzu-fa10374d39effc79b5b9ed789bf873030cb08d7f.tar.gz yuzu-fa10374d39effc79b5b9ed789bf873030cb08d7f.tar.bz2 yuzu-fa10374d39effc79b5b9ed789bf873030cb08d7f.tar.lz yuzu-fa10374d39effc79b5b9ed789bf873030cb08d7f.tar.xz yuzu-fa10374d39effc79b5b9ed789bf873030cb08d7f.tar.zst yuzu-fa10374d39effc79b5b9ed789bf873030cb08d7f.zip |
Diffstat (limited to 'src/audio_core/out')
-rw-r--r-- | src/audio_core/out/audio_out_system.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/audio_core/out/audio_out_system.cpp b/src/audio_core/out/audio_out_system.cpp index a66208ed9..e096a1dac 100644 --- a/src/audio_core/out/audio_out_system.cpp +++ b/src/audio_core/out/audio_out_system.cpp @@ -24,7 +24,6 @@ System::~System() { void System::Finalize() { Stop(); session->Finalize(); - buffer_event->Signal(); } std::string_view System::GetDefaultOutputDeviceName() const { @@ -102,6 +101,10 @@ Result System::Stop() { if (state == State::Started) { session->Stop(); session->SetVolume(0.0f); + session->ClearBuffers(); + if (buffers.ReleaseBuffers(system.CoreTiming(), *session, true)) { + buffer_event->Signal(); + } state = State::Stopped; } @@ -138,7 +141,7 @@ void System::RegisterBuffers() { } void System::ReleaseBuffers() { - bool signal{buffers.ReleaseBuffers(system.CoreTiming(), *session)}; + bool signal{buffers.ReleaseBuffers(system.CoreTiming(), *session, false)}; if (signal) { // Signal if any buffer was released, or if none are registered, we need more. buffer_event->Signal(); |