From 1a954b2a596fdfd4fc4b5feb9b43c8147de4cc7f Mon Sep 17 00:00:00 2001 From: Lioncash Date: Thu, 26 Nov 2020 15:19:08 -0500 Subject: service: Eliminate usages of the global system instance Completely removes all usages of the global system instance within the services code by passing in the using system instance to the services. --- src/core/hle/service/audio/hwopus.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/core/hle/service/audio/hwopus.cpp') diff --git a/src/core/hle/service/audio/hwopus.cpp b/src/core/hle/service/audio/hwopus.cpp index f1d81602c..ea3414fd2 100644 --- a/src/core/hle/service/audio/hwopus.cpp +++ b/src/core/hle/service/audio/hwopus.cpp @@ -160,8 +160,9 @@ private: class IHardwareOpusDecoderManager final : public ServiceFramework { public: - explicit IHardwareOpusDecoderManager(OpusDecoderState decoder_state) - : ServiceFramework("IHardwareOpusDecoderManager"), decoder_state{std::move(decoder_state)} { + explicit IHardwareOpusDecoderManager(Core::System& system_, OpusDecoderState decoder_state) + : ServiceFramework{system_, "IHardwareOpusDecoderManager"}, decoder_state{ + std::move(decoder_state)} { // clang-format off static const FunctionInfo functions[] = { {0, &IHardwareOpusDecoderManager::DecodeInterleavedOld, "DecodeInterleavedOld"}, @@ -287,10 +288,10 @@ void HwOpus::OpenOpusDecoder(Kernel::HLERequestContext& ctx) { IPC::ResponseBuilder rb{ctx, 2, 0, 1}; rb.Push(RESULT_SUCCESS); rb.PushIpcInterface( - OpusDecoderState{std::move(decoder), sample_rate, channel_count}); + system, OpusDecoderState{std::move(decoder), sample_rate, channel_count}); } -HwOpus::HwOpus() : ServiceFramework("hwopus") { +HwOpus::HwOpus(Core::System& system_) : ServiceFramework{system_, "hwopus"} { static const FunctionInfo functions[] = { {0, &HwOpus::OpenOpusDecoder, "OpenOpusDecoder"}, {1, &HwOpus::GetWorkBufferSize, "GetWorkBufferSize"}, -- cgit v1.2.3