summaryrefslogtreecommitdiff
path: root/src/audio_core/out
diff options
context:
space:
mode:
authorGravatar bunnei2022-09-10 11:01:11 -0700
committerGravatar GitHub2022-09-10 11:01:11 -0700
commitcd4b9bffb2d42b1f8d4386b251a35344891df55a (patch)
tree53454fa29c30e9fa7f1f2c31f9586839d799f277 /src/audio_core/out
parentMerge pull request #8863 from german77/triggers (diff)
parentDon't stall with nvdec (diff)
downloadyuzu-cd4b9bffb2d42b1f8d4386b251a35344891df55a.tar.gz
yuzu-cd4b9bffb2d42b1f8d4386b251a35344891df55a.tar.xz
yuzu-cd4b9bffb2d42b1f8d4386b251a35344891df55a.zip
Merge pull request #8842 from Kelebek1/AudOut
[audio_core] Rework audio output
Diffstat (limited to 'src/audio_core/out')
-rw-r--r--src/audio_core/out/audio_out_system.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/audio_core/out/audio_out_system.cpp b/src/audio_core/out/audio_out_system.cpp
index 35afddf06..8941b09a0 100644
--- a/src/audio_core/out/audio_out_system.cpp
+++ b/src/audio_core/out/audio_out_system.cpp
@@ -92,6 +92,7 @@ Result System::Start() {
92 std::vector<AudioBuffer> buffers_to_flush{}; 92 std::vector<AudioBuffer> buffers_to_flush{};
93 buffers.RegisterBuffers(buffers_to_flush); 93 buffers.RegisterBuffers(buffers_to_flush);
94 session->AppendBuffers(buffers_to_flush); 94 session->AppendBuffers(buffers_to_flush);
95 session->SetRingSize(static_cast<u32>(buffers_to_flush.size()));
95 96
96 return ResultSuccess; 97 return ResultSuccess;
97} 98}
@@ -111,8 +112,13 @@ bool System::AppendBuffer(const AudioOutBuffer& buffer, u64 tag) {
111 return false; 112 return false;
112 } 113 }
113 114
114 AudioBuffer new_buffer{ 115 const auto timestamp{buffers.GetNextTimestamp()};
115 .played_timestamp = 0, .samples = buffer.samples, .tag = tag, .size = buffer.size}; 116 AudioBuffer new_buffer{.start_timestamp = timestamp,
117 .end_timestamp = timestamp + buffer.size / (channel_count * sizeof(s16)),
118 .played_timestamp = 0,
119 .samples = buffer.samples,
120 .tag = tag,
121 .size = buffer.size};
116 122
117 buffers.AppendBuffer(new_buffer); 123 buffers.AppendBuffer(new_buffer);
118 RegisterBuffers(); 124 RegisterBuffers();