summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/core/hle/service/audio/audren_u.cpp27
1 files changed, 21 insertions, 6 deletions
diff --git a/src/core/hle/service/audio/audren_u.cpp b/src/core/hle/service/audio/audren_u.cpp
index 381a66ba5..bc69117c6 100644
--- a/src/core/hle/service/audio/audren_u.cpp
+++ b/src/core/hle/service/audio/audren_u.cpp
@@ -50,7 +50,7 @@ public:
50 {7, &IAudioRenderer::QuerySystemEvent, "QuerySystemEvent"}, 50 {7, &IAudioRenderer::QuerySystemEvent, "QuerySystemEvent"},
51 {8, &IAudioRenderer::SetRenderingTimeLimit, "SetRenderingTimeLimit"}, 51 {8, &IAudioRenderer::SetRenderingTimeLimit, "SetRenderingTimeLimit"},
52 {9, &IAudioRenderer::GetRenderingTimeLimit, "GetRenderingTimeLimit"}, 52 {9, &IAudioRenderer::GetRenderingTimeLimit, "GetRenderingTimeLimit"},
53 {10, nullptr, "RequestUpdateAuto"}, 53 {10, &IAudioRenderer::RequestUpdate, "RequestUpdateAuto"},
54 {11, nullptr, "ExecuteAudioRendererRendering"}, 54 {11, nullptr, "ExecuteAudioRendererRendering"},
55 }; 55 };
56 // clang-format on 56 // clang-format on
@@ -113,15 +113,30 @@ private:
113 113
114 // These buffers are written manually to avoid an issue with WriteBuffer throwing errors for 114 // These buffers are written manually to avoid an issue with WriteBuffer throwing errors for
115 // checking size 0. Performance size is 0 for most games. 115 // checking size 0. Performance size is 0 for most games.
116 const auto buffers{ctx.BufferDescriptorB()}; 116
117 std::vector<u8> output(buffers[0].Size(), 0); 117 std::vector<u8> output{};
118 std::vector<u8> performance(buffers[1].Size(), 0); 118 std::vector<u8> performance{};
119 auto is_buffer_b{ctx.BufferDescriptorB()[0].Size() != 0};
120 if (is_buffer_b) {
121 const auto buffersB{ctx.BufferDescriptorB()};
122 output.resize(buffersB[0].Size(), 0);
123 performance.resize(buffersB[1].Size(), 0);
124 } else {
125 const auto buffersC{ctx.BufferDescriptorC()};
126 output.resize(buffersC[0].Size(), 0);
127 performance.resize(buffersC[1].Size(), 0);
128 }
119 129
120 auto result = impl->RequestUpdate(input, performance, output); 130 auto result = impl->RequestUpdate(input, performance, output);
121 131
122 if (result.IsSuccess()) { 132 if (result.IsSuccess()) {
123 ctx.WriteBufferB(output.data(), output.size(), 0); 133 if (is_buffer_b) {
124 ctx.WriteBufferB(performance.data(), performance.size(), 1); 134 ctx.WriteBufferB(output.data(), output.size(), 0);
135 ctx.WriteBufferB(performance.data(), performance.size(), 1);
136 } else {
137 ctx.WriteBufferC(output.data(), output.size(), 0);
138 ctx.WriteBufferC(performance.data(), performance.size(), 1);
139 }
125 } else { 140 } else {
126 LOG_ERROR(Service_Audio, "RequestUpdate failed error 0x{:02X}!", result.description); 141 LOG_ERROR(Service_Audio, "RequestUpdate failed error 0x{:02X}!", result.description);
127 } 142 }