diff options
| author | 2022-09-10 11:01:11 -0700 | |
|---|---|---|
| committer | 2022-09-10 11:01:11 -0700 | |
| commit | cd4b9bffb2d42b1f8d4386b251a35344891df55a (patch) | |
| tree | 53454fa29c30e9fa7f1f2c31f9586839d799f277 /src/audio_core/in | |
| parent | Merge pull request #8863 from german77/triggers (diff) | |
| parent | Don't stall with nvdec (diff) | |
| download | yuzu-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/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() { | |||
| 93 | std::vector<AudioBuffer> buffers_to_flush{}; | 93 | std::vector<AudioBuffer> buffers_to_flush{}; |
| 94 | buffers.RegisterBuffers(buffers_to_flush); | 94 | buffers.RegisterBuffers(buffers_to_flush); |
| 95 | session->AppendBuffers(buffers_to_flush); | 95 | session->AppendBuffers(buffers_to_flush); |
| 96 | session->SetRingSize(static_cast<u32>(buffers_to_flush.size())); | ||
| 96 | 97 | ||
| 97 | return ResultSuccess; | 98 | return ResultSuccess; |
| 98 | } | 99 | } |
| @@ -112,8 +113,13 @@ bool System::AppendBuffer(const AudioInBuffer& buffer, const u64 tag) { | |||
| 112 | return false; | 113 | return false; |
| 113 | } | 114 | } |
| 114 | 115 | ||
| 115 | AudioBuffer new_buffer{ | 116 | const auto timestamp{buffers.GetNextTimestamp()}; |
| 116 | .played_timestamp = 0, .samples = buffer.samples, .tag = tag, .size = buffer.size}; | 117 | AudioBuffer new_buffer{.start_timestamp = timestamp, |
| 118 | .end_timestamp = timestamp + buffer.size / (channel_count * sizeof(s16)), | ||
| 119 | .played_timestamp = 0, | ||
| 120 | .samples = buffer.samples, | ||
| 121 | .tag = tag, | ||
| 122 | .size = buffer.size}; | ||
| 117 | 123 | ||
| 118 | buffers.AppendBuffer(new_buffer); | 124 | buffers.AppendBuffer(new_buffer); |
| 119 | RegisterBuffers(); | 125 | RegisterBuffers(); |