diff options
author | Kelebek1 <eeeedddccc@hotmail.co.uk> | 2022-11-22 16:32:11 +0100 |
---|---|---|
committer | Kelebek1 <eeeedddccc@hotmail.co.uk> | 2022-11-22 16:32:11 +0100 |
commit | 84d4da89a5f6fb331672b1ac40c72cec5d4680ab (patch) | |
tree | 5a02fa837ebe0d20dee3b0fef58ced9329ccefb7 /src/audio_core | |
parent | Merge pull request #9292 from Morph1984/amiibo-web-service (diff) | |
download | yuzu-84d4da89a5f6fb331672b1ac40c72cec5d4680ab.tar yuzu-84d4da89a5f6fb331672b1ac40c72cec5d4680ab.tar.gz yuzu-84d4da89a5f6fb331672b1ac40c72cec5d4680ab.tar.bz2 yuzu-84d4da89a5f6fb331672b1ac40c72cec5d4680ab.tar.lz yuzu-84d4da89a5f6fb331672b1ac40c72cec5d4680ab.tar.xz yuzu-84d4da89a5f6fb331672b1ac40c72cec5d4680ab.tar.zst yuzu-84d4da89a5f6fb331672b1ac40c72cec5d4680ab.zip |
Diffstat (limited to 'src/audio_core')
-rw-r--r-- | src/audio_core/renderer/command/command_buffer.cpp | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/audio_core/renderer/command/command_buffer.cpp b/src/audio_core/renderer/command/command_buffer.cpp index 2ef879ee1..8c6fe97e7 100644 --- a/src/audio_core/renderer/command/command_buffer.cpp +++ b/src/audio_core/renderer/command/command_buffer.cpp @@ -460,21 +460,23 @@ void CommandBuffer::GenerateDeviceSinkCommand(const s32 node_id, const s16 buffe cmd.session_id = session_id; + cmd.input_count = parameter.input_count; + s16 max_input{0}; + for (u32 i = 0; i < parameter.input_count; i++) { + cmd.inputs[i] = buffer_offset + parameter.inputs[i]; + max_input = std::max(max_input, cmd.inputs[i]); + } + if (state.upsampler_info != nullptr) { const auto size_{state.upsampler_info->sample_count * parameter.input_count}; const auto size_bytes{size_ * sizeof(s32)}; const auto addr{memory_pool->Translate(state.upsampler_info->samples_pos, size_bytes)}; cmd.sample_buffer = {reinterpret_cast<s32*>(addr), - parameter.input_count * state.upsampler_info->sample_count}; + (max_input + 1) * state.upsampler_info->sample_count}; } else { cmd.sample_buffer = samples_buffer; } - cmd.input_count = parameter.input_count; - for (u32 i = 0; i < parameter.input_count; i++) { - cmd.inputs[i] = buffer_offset + parameter.inputs[i]; - } - GenerateEnd<DeviceSinkCommand>(cmd); } |