From 6f7cb69c94bef0795f054d881e061745f69d1eda Mon Sep 17 00:00:00 2001 From: Kelebek1 Date: Mon, 29 May 2023 00:35:51 +0100 Subject: Use spans over guest memory where possible instead of copying data. --- src/audio_core/device/device_session.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/audio_core/device') diff --git a/src/audio_core/device/device_session.cpp b/src/audio_core/device/device_session.cpp index 86811fcb8..c41d9d1ea 100644 --- a/src/audio_core/device/device_session.cpp +++ b/src/audio_core/device/device_session.cpp @@ -92,9 +92,9 @@ void DeviceSession::AppendBuffers(std::span buffers) { if (type == Sink::StreamType::In) { stream->AppendBuffer(new_buffer, tmp_samples); } else { - system.ApplicationMemory().ReadBlockUnsafe(buffer.samples, tmp_samples.data(), - buffer.size); - stream->AppendBuffer(new_buffer, tmp_samples); + Core::Memory::CpuGuestMemory samples( + system.ApplicationMemory(), buffer.samples, buffer.size / sizeof(s16)); + stream->AppendBuffer(new_buffer, samples); } } } -- cgit v1.2.3