diff options
| author | Zach Hilman <zachhilman@gmail.com> | 2018-11-27 09:18:29 -0500 |
|---|---|---|
| committer | Zach Hilman <zachhilman@gmail.com> | 2018-11-29 08:48:40 -0500 |
| commit | a342bcc9b130e9bd78720e09e04c92dcac8840d0 (patch) | |
| tree | df1d16c2a71b121fc449b53fc931c6fac8ccf82a /src/core/hle/service/audio/audout_u.cpp | |
| parent | ff610103b58b3e0dd39fafb539a1cc0bc0fae577 (diff) | |
kernel/event: Reference ReadableEvent from WritableEvent
Diffstat (limited to 'src/core/hle/service/audio/audout_u.cpp')
| -rw-r--r-- | src/core/hle/service/audio/audout_u.cpp | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/src/core/hle/service/audio/audout_u.cpp b/src/core/hle/service/audio/audout_u.cpp index b5012e579..22e5c85ab 100644 --- a/src/core/hle/service/audio/audout_u.cpp +++ b/src/core/hle/service/audio/audout_u.cpp @@ -69,11 +69,12 @@ public: // This is the event handle used to check if the audio buffer was released auto& kernel = Core::System::GetInstance().Kernel(); - buffer_event = Kernel::WritableEvent::CreateRegisteredEventPair( - kernel, Kernel::ResetType::Sticky, "IAudioOutBufferReleased"); + buffer_event = Kernel::WritableEvent::CreateEventPair(kernel, Kernel::ResetType::Sticky, + "IAudioOutBufferReleased"); stream = audio_core.OpenStream(audio_params.sample_rate, audio_params.channel_count, - std::move(unique_name), [=]() { buffer_event->Signal(); }); + std::move(unique_name), + [=]() { buffer_event.writable->Signal(); }); } private: @@ -123,9 +124,7 @@ private: IPC::ResponseBuilder rb{ctx, 2, 1}; rb.Push(RESULT_SUCCESS); - const auto& event{ - Core::System::GetInstance().Kernel().FindNamedEvent("IAudioOutBufferReleased")}; - rb.PushCopyObjects(event->second); + rb.PushCopyObjects(buffer_event.readable); } void AppendAudioOutBufferImpl(Kernel::HLERequestContext& ctx) { @@ -191,8 +190,8 @@ private: AudoutParams audio_params{}; - /// This is the evend handle used to check if the audio buffer was released - Kernel::SharedPtr<Kernel::WritableEvent> buffer_event; + /// This is the event handle used to check if the audio buffer was released + Kernel::EventPair buffer_event; }; void AudOutU::ListAudioOutsImpl(Kernel::HLERequestContext& ctx) { |
