diff options
author | Kelebek1 <eeeedddccc@hotmail.co.uk> | 2022-08-01 03:58:13 +0200 |
---|---|---|
committer | Kelebek1 <eeeedddccc@hotmail.co.uk> | 2022-09-02 05:43:04 +0200 |
commit | ea9ff71725113b8dbb159917c57aa536bba0cb53 (patch) | |
tree | 512cce0fea5eb511aa7803bc67f741815885bfcb /src/audio_core/in | |
parent | Merge pull request #8752 from vonchenplus/rectangle_texture (diff) | |
download | yuzu-ea9ff71725113b8dbb159917c57aa536bba0cb53.tar yuzu-ea9ff71725113b8dbb159917c57aa536bba0cb53.tar.gz yuzu-ea9ff71725113b8dbb159917c57aa536bba0cb53.tar.bz2 yuzu-ea9ff71725113b8dbb159917c57aa536bba0cb53.tar.lz yuzu-ea9ff71725113b8dbb159917c57aa536bba0cb53.tar.xz yuzu-ea9ff71725113b8dbb159917c57aa536bba0cb53.tar.zst yuzu-ea9ff71725113b8dbb159917c57aa536bba0cb53.zip |
Diffstat (limited to 'src/audio_core/in')
-rw-r--r-- | src/audio_core/in/audio_in_system.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/audio_core/in/audio_in_system.cpp b/src/audio_core/in/audio_in_system.cpp index ec5d37ed4..7e80ba03c 100644 --- a/src/audio_core/in/audio_in_system.cpp +++ b/src/audio_core/in/audio_in_system.cpp @@ -93,6 +93,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; } @@ -112,8 +113,13 @@ bool System::AppendBuffer(const AudioInBuffer& buffer, const 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(); |