summaryrefslogtreecommitdiffstats
path: root/src/audio_core/device/device_session.cpp
diff options
context:
space:
mode:
authorKelebek1 <eeeedddccc@hotmail.co.uk>2023-05-23 15:45:54 +0200
committerKelebek1 <eeeedddccc@hotmail.co.uk>2023-06-22 09:05:10 +0200
commit5da70f719703084482933e103e561cc98163f370 (patch)
tree1926842ed2b90bf92b89cec6a314bb28c7287fe9 /src/audio_core/device/device_session.cpp
parentMerge pull request #10086 from Morph1984/coretiming-ng-1 (diff)
downloadyuzu-5da70f719703084482933e103e561cc98163f370.tar
yuzu-5da70f719703084482933e103e561cc98163f370.tar.gz
yuzu-5da70f719703084482933e103e561cc98163f370.tar.bz2
yuzu-5da70f719703084482933e103e561cc98163f370.tar.lz
yuzu-5da70f719703084482933e103e561cc98163f370.tar.xz
yuzu-5da70f719703084482933e103e561cc98163f370.tar.zst
yuzu-5da70f719703084482933e103e561cc98163f370.zip
Diffstat (limited to '')
-rw-r--r--src/audio_core/device/device_session.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/audio_core/device/device_session.cpp b/src/audio_core/device/device_session.cpp
index b5c0ef0e6..86811fcb8 100644
--- a/src/audio_core/device/device_session.cpp
+++ b/src/audio_core/device/device_session.cpp
@@ -79,7 +79,7 @@ void DeviceSession::ClearBuffers() {
}
}
-void DeviceSession::AppendBuffers(std::span<const AudioBuffer> buffers) const {
+void DeviceSession::AppendBuffers(std::span<const AudioBuffer> buffers) {
for (const auto& buffer : buffers) {
Sink::SinkBuffer new_buffer{
.frames = buffer.size / (channel_count * sizeof(s16)),
@@ -88,13 +88,13 @@ void DeviceSession::AppendBuffers(std::span<const AudioBuffer> buffers) const {
.consumed = false,
};
+ tmp_samples.resize_destructive(buffer.size / sizeof(s16));
if (type == Sink::StreamType::In) {
- std::vector<s16> samples{};
- stream->AppendBuffer(new_buffer, samples);
+ stream->AppendBuffer(new_buffer, tmp_samples);
} else {
- std::vector<s16> samples(buffer.size / sizeof(s16));
- system.ApplicationMemory().ReadBlockUnsafe(buffer.samples, samples.data(), buffer.size);
- stream->AppendBuffer(new_buffer, samples);
+ system.ApplicationMemory().ReadBlockUnsafe(buffer.samples, tmp_samples.data(),
+ buffer.size);
+ stream->AppendBuffer(new_buffer, tmp_samples);
}
}
}