diff options
| author | 2023-04-24 12:36:52 +0200 | |
|---|---|---|
| committer | 2023-04-24 12:36:52 +0200 | |
| commit | 47cd0586ee6ee28c05307df79821f855d9d0ee2d (patch) | |
| tree | eeb2e702d9e9f535ac819689f1a8fee564b1a54f /src | |
| parent | Merge pull request #10069 from liamwhite/log (diff) | |
| parent | core: audio: return result when audio_out initialize failed (diff) | |
| download | yuzu-47cd0586ee6ee28c05307df79821f855d9d0ee2d.tar.gz yuzu-47cd0586ee6ee28c05307df79821f855d9d0ee2d.tar.xz yuzu-47cd0586ee6ee28c05307df79821f855d9d0ee2d.zip | |
Merge pull request #10056 from vonchenplus/audout_u
core: audio: return result when audio_out initialize failed
Diffstat (limited to 'src')
| -rw-r--r-- | src/core/hle/service/audio/audout_u.cpp | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/core/hle/service/audio/audout_u.cpp b/src/core/hle/service/audio/audout_u.cpp index 23b8be993..3e62fa4fc 100644 --- a/src/core/hle/service/audio/audout_u.cpp +++ b/src/core/hle/service/audio/audout_u.cpp | |||
| @@ -49,12 +49,6 @@ public: | |||
| 49 | }; | 49 | }; |
| 50 | // clang-format on | 50 | // clang-format on |
| 51 | RegisterHandlers(functions); | 51 | RegisterHandlers(functions); |
| 52 | |||
| 53 | if (impl->GetSystem() | ||
| 54 | .Initialize(device_name, in_params, handle, applet_resource_user_id) | ||
| 55 | .IsError()) { | ||
| 56 | LOG_ERROR(Service_Audio, "Failed to initialize the AudioOut System!"); | ||
| 57 | } | ||
| 58 | } | 52 | } |
| 59 | 53 | ||
| 60 | ~IAudioOut() override { | 54 | ~IAudioOut() override { |
| @@ -287,6 +281,14 @@ void AudOutU::OpenAudioOut(HLERequestContext& ctx) { | |||
| 287 | 281 | ||
| 288 | auto audio_out = std::make_shared<IAudioOut>(system, *impl, new_session_id, device_name, | 282 | auto audio_out = std::make_shared<IAudioOut>(system, *impl, new_session_id, device_name, |
| 289 | in_params, handle, applet_resource_user_id); | 283 | in_params, handle, applet_resource_user_id); |
| 284 | result = audio_out->GetImpl()->GetSystem().Initialize(device_name, in_params, handle, | ||
| 285 | applet_resource_user_id); | ||
| 286 | if (result.IsError()) { | ||
| 287 | LOG_ERROR(Service_Audio, "Failed to initialize the AudioOut System!"); | ||
| 288 | IPC::ResponseBuilder rb{ctx, 2}; | ||
| 289 | rb.Push(result); | ||
| 290 | return; | ||
| 291 | } | ||
| 290 | 292 | ||
| 291 | impl->sessions[new_session_id] = audio_out->GetImpl(); | 293 | impl->sessions[new_session_id] = audio_out->GetImpl(); |
| 292 | impl->applet_resource_user_ids[new_session_id] = applet_resource_user_id; | 294 | impl->applet_resource_user_ids[new_session_id] = applet_resource_user_id; |