summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/audio_core/device/audio_buffers.h2
-rw-r--r--src/audio_core/in/audio_in_system.cpp14
-rw-r--r--src/audio_core/out/audio_out_system.cpp14
3 files changed, 17 insertions, 13 deletions
diff --git a/src/audio_core/device/audio_buffers.h b/src/audio_core/device/audio_buffers.h
index 4918a61c7..3dae1a3b7 100644
--- a/src/audio_core/device/audio_buffers.h
+++ b/src/audio_core/device/audio_buffers.h
@@ -36,7 +36,7 @@ public:
36 * 36 *
37 * @param buffer - The new buffer. 37 * @param buffer - The new buffer.
38 */ 38 */
39 void AppendBuffer(AudioBuffer& buffer) { 39 void AppendBuffer(const AudioBuffer& buffer) {
40 std::scoped_lock l{lock}; 40 std::scoped_lock l{lock};
41 buffers[appended_index] = buffer; 41 buffers[appended_index] = buffer;
42 appended_count++; 42 appended_count++;
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();
diff --git a/src/audio_core/out/audio_out_system.cpp b/src/audio_core/out/audio_out_system.cpp
index 8941b09a0..ae605f65b 100644
--- a/src/audio_core/out/audio_out_system.cpp
+++ b/src/audio_core/out/audio_out_system.cpp
@@ -113,12 +113,14 @@ bool System::AppendBuffer(const AudioOutBuffer& buffer, u64 tag) {
113 } 113 }
114 114
115 const auto timestamp{buffers.GetNextTimestamp()}; 115 const auto timestamp{buffers.GetNextTimestamp()};
116 AudioBuffer new_buffer{.start_timestamp = timestamp, 116 const AudioBuffer new_buffer{
117 .end_timestamp = timestamp + buffer.size / (channel_count * sizeof(s16)), 117 .start_timestamp = timestamp,
118 .played_timestamp = 0, 118 .end_timestamp = timestamp + buffer.size / (channel_count * sizeof(s16)),
119 .samples = buffer.samples, 119 .played_timestamp = 0,
120 .tag = tag, 120 .samples = buffer.samples,
121 .size = buffer.size}; 121 .tag = tag,
122 .size = buffer.size,
123 };
122 124
123 buffers.AppendBuffer(new_buffer); 125 buffers.AppendBuffer(new_buffer);
124 RegisterBuffers(); 126 RegisterBuffers();