From e9109cb5f214218909c978b7fbd5a7cb71bdf890 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Fri, 16 Sep 2022 09:36:00 -0400 Subject: audio_buffers: Pass by const-ref in AppendBuffers This function doesn't modify the passed in buffer, so we can make that explicit. --- src/audio_core/in/audio_in_system.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'src/audio_core/in') diff --git a/src/audio_core/in/audio_in_system.cpp b/src/audio_core/in/audio_in_system.cpp index 7e80ba03c..9c6039aea 100644 --- a/src/audio_core/in/audio_in_system.cpp +++ b/src/audio_core/in/audio_in_system.cpp @@ -114,12 +114,14 @@ bool System::AppendBuffer(const AudioInBuffer& buffer, const u64 tag) { } const auto timestamp{buffers.GetNextTimestamp()}; - AudioBuffer new_buffer{.start_timestamp = timestamp, - .end_timestamp = timestamp + buffer.size / (channel_count * sizeof(s16)), - .played_timestamp = 0, - .samples = buffer.samples, - .tag = tag, - .size = buffer.size}; + const AudioBuffer new_buffer{ + .start_timestamp = timestamp, + .end_timestamp = timestamp + buffer.size / (channel_count * sizeof(s16)), + .played_timestamp = 0, + .samples = buffer.samples, + .tag = tag, + .size = buffer.size, + }; buffers.AppendBuffer(new_buffer); RegisterBuffers(); -- cgit v1.2.3