diff options
| author | bunnei <bunneidev@gmail.com> | 2022-09-10 11:01:11 -0700 | 
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-09-10 11:01:11 -0700 | 
| commit | cd4b9bffb2d42b1f8d4386b251a35344891df55a (patch) | |
| tree | 53454fa29c30e9fa7f1f2c31f9586839d799f277 /src/audio_core/out | |
| parent | 16080b6e4e28b49e0e320879ebbab34199fb81c2 (diff) | |
| parent | 2129d040a509754839b82b1ff6d387cb4f84f168 (diff) | |
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.cpp | 10 | 
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() {      std::vector<AudioBuffer> buffers_to_flush{};      buffers.RegisterBuffers(buffers_to_flush);      session->AppendBuffers(buffers_to_flush); +    session->SetRingSize(static_cast<u32>(buffers_to_flush.size()));      return ResultSuccess;  } @@ -111,8 +112,13 @@ bool System::AppendBuffer(const AudioOutBuffer& buffer, u64 tag) {          return false;      } -    AudioBuffer new_buffer{ -        .played_timestamp = 0, .samples = buffer.samples, .tag = tag, .size = buffer.size}; +    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};      buffers.AppendBuffer(new_buffer);      RegisterBuffers(); | 
