diff options
| author | 2022-09-16 09:36:00 -0400 | |
|---|---|---|
| committer | 2022-09-16 09:36:03 -0400 | |
| commit | e9109cb5f214218909c978b7fbd5a7cb71bdf890 (patch) | |
| tree | 626a7b1289f6eef0ce274e64348327a29d454e39 /src/audio_core/in | |
| parent | device_session: Convert for loop into ranged for in AppendBuffers (diff) | |
| download | yuzu-e9109cb5f214218909c978b7fbd5a7cb71bdf890.tar.gz yuzu-e9109cb5f214218909c978b7fbd5a7cb71bdf890.tar.xz yuzu-e9109cb5f214218909c978b7fbd5a7cb71bdf890.zip | |
audio_buffers: Pass by const-ref in AppendBuffers
This function doesn't modify the passed in buffer, so we can make that
explicit.
Diffstat (limited to 'src/audio_core/in')
| -rw-r--r-- | src/audio_core/in/audio_in_system.cpp | 14 |
1 files changed, 8 insertions, 6 deletions
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) { | |||
| 114 | } | 114 | } |
| 115 | 115 | ||
| 116 | const auto timestamp{buffers.GetNextTimestamp()}; | 116 | const auto timestamp{buffers.GetNextTimestamp()}; |
| 117 | AudioBuffer new_buffer{.start_timestamp = timestamp, | 117 | const AudioBuffer new_buffer{ |
| 118 | .end_timestamp = timestamp + buffer.size / (channel_count * sizeof(s16)), | 118 | .start_timestamp = timestamp, |
| 119 | .played_timestamp = 0, | 119 | .end_timestamp = timestamp + buffer.size / (channel_count * sizeof(s16)), |
| 120 | .samples = buffer.samples, | 120 | .played_timestamp = 0, |
| 121 | .tag = tag, | 121 | .samples = buffer.samples, |
| 122 | .size = buffer.size}; | 122 | .tag = tag, |
| 123 | .size = buffer.size, | ||
| 124 | }; | ||
| 123 | 125 | ||
| 124 | buffers.AppendBuffer(new_buffer); | 126 | buffers.AppendBuffer(new_buffer); |
| 125 | RegisterBuffers(); | 127 | RegisterBuffers(); |