summaryrefslogtreecommitdiffstats
path: root/src/audio_core/device
diff options
context:
space:
mode:
authorLioncash <mathew1800@gmail.com>2022-09-16 15:32:55 +0200
committerLioncash <mathew1800@gmail.com>2022-09-16 15:32:57 +0200
commitcb2a33babc831fa39c86663714f0951743530b2b (patch)
treea6e21ee075ee53a9b3dede5a58e028d0503a6c77 /src/audio_core/device
parentdevice_session: Pass arguments by const-ref in relevant functions (diff)
downloadyuzu-cb2a33babc831fa39c86663714f0951743530b2b.tar
yuzu-cb2a33babc831fa39c86663714f0951743530b2b.tar.gz
yuzu-cb2a33babc831fa39c86663714f0951743530b2b.tar.bz2
yuzu-cb2a33babc831fa39c86663714f0951743530b2b.tar.lz
yuzu-cb2a33babc831fa39c86663714f0951743530b2b.tar.xz
yuzu-cb2a33babc831fa39c86663714f0951743530b2b.tar.zst
yuzu-cb2a33babc831fa39c86663714f0951743530b2b.zip
Diffstat (limited to 'src/audio_core/device')
-rw-r--r--src/audio_core/device/device_session.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/audio_core/device/device_session.cpp b/src/audio_core/device/device_session.cpp
index 6cde33f93..995060414 100644
--- a/src/audio_core/device/device_session.cpp
+++ b/src/audio_core/device/device_session.cpp
@@ -74,11 +74,11 @@ void DeviceSession::Stop() {
}
void DeviceSession::AppendBuffers(std::span<const AudioBuffer> buffers) const {
- for (size_t i = 0; i < buffers.size(); i++) {
+ for (const auto& buffer : buffers) {
Sink::SinkBuffer new_buffer{
- .frames = buffers[i].size / (channel_count * sizeof(s16)),
+ .frames = buffer.size / (channel_count * sizeof(s16)),
.frames_played = 0,
- .tag = buffers[i].tag,
+ .tag = buffer.tag,
.consumed = false,
};
@@ -86,8 +86,8 @@ void DeviceSession::AppendBuffers(std::span<const AudioBuffer> buffers) const {
std::vector<s16> samples{};
stream->AppendBuffer(new_buffer, samples);
} else {
- std::vector<s16> samples(buffers[i].size / sizeof(s16));
- system.Memory().ReadBlockUnsafe(buffers[i].samples, samples.data(), buffers[i].size);
+ std::vector<s16> samples(buffer.size / sizeof(s16));
+ system.Memory().ReadBlockUnsafe(buffer.samples, samples.data(), buffer.size);
stream->AppendBuffer(new_buffer, samples);
}
}