diff options
author | bunnei <bunneidev@gmail.com> | 2020-12-29 03:23:42 +0100 |
---|---|---|
committer | bunnei <bunneidev@gmail.com> | 2020-12-29 06:33:34 +0100 |
commit | 7d77a3f88f7a1e68d9846ca7c69cce051d1a33d2 (patch) | |
tree | be882bb9b5d144861673178a1fdaad9a19504c5a /src/core/hle/service/audio | |
parent | audio_core: stream: Ensure buffer is valid before release. (diff) | |
download | yuzu-7d77a3f88f7a1e68d9846ca7c69cce051d1a33d2.tar yuzu-7d77a3f88f7a1e68d9846ca7c69cce051d1a33d2.tar.gz yuzu-7d77a3f88f7a1e68d9846ca7c69cce051d1a33d2.tar.bz2 yuzu-7d77a3f88f7a1e68d9846ca7c69cce051d1a33d2.tar.lz yuzu-7d77a3f88f7a1e68d9846ca7c69cce051d1a33d2.tar.xz yuzu-7d77a3f88f7a1e68d9846ca7c69cce051d1a33d2.tar.zst yuzu-7d77a3f88f7a1e68d9846ca7c69cce051d1a33d2.zip |
Diffstat (limited to 'src/core/hle/service/audio')
-rw-r--r-- | src/core/hle/service/audio/audout_u.cpp | 6 | ||||
-rw-r--r-- | src/core/hle/service/audio/audren_u.cpp | 14 |
2 files changed, 11 insertions, 9 deletions
diff --git a/src/core/hle/service/audio/audout_u.cpp b/src/core/hle/service/audio/audout_u.cpp index 145f47ee2..0cd797109 100644 --- a/src/core/hle/service/audio/audout_u.cpp +++ b/src/core/hle/service/audio/audout_u.cpp @@ -70,8 +70,10 @@ public: Kernel::WritableEvent::CreateEventPair(system.Kernel(), "IAudioOutBufferReleased"); stream = audio_core.OpenStream(system.CoreTiming(), audio_params.sample_rate, - audio_params.channel_count, std::move(unique_name), - [this] { buffer_event.writable->Signal(); }); + audio_params.channel_count, std::move(unique_name), [this] { + const auto guard = LockService(); + buffer_event.writable->Signal(); + }); } private: diff --git a/src/core/hle/service/audio/audren_u.cpp b/src/core/hle/service/audio/audren_u.cpp index 6e7b7316c..c5c22d053 100644 --- a/src/core/hle/service/audio/audren_u.cpp +++ b/src/core/hle/service/audio/audren_u.cpp @@ -49,16 +49,16 @@ public: system_event = Kernel::WritableEvent::CreateEventPair(system.Kernel(), "IAudioRenderer:SystemEvent"); - renderer = std::make_unique<AudioCore::AudioRenderer>(system.CoreTiming(), system.Memory(), - audren_params, system_event.writable, - instance_number); + renderer = std::make_unique<AudioCore::AudioRenderer>( + system.CoreTiming(), system.Memory(), audren_params, + [this]() { + const auto guard = LockService(); + system_event.writable->Signal(); + }, + instance_number); } private: - void UpdateAudioCallback() { - system_event.writable->Signal(); - } - void GetSampleRate(Kernel::HLERequestContext& ctx) { LOG_DEBUG(Service_Audio, "called"); |