diff options
author | bunnei <bunneidev@gmail.com> | 2018-09-13 00:23:54 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-09-13 00:23:54 +0200 |
commit | 926dd415871a8c38605678f2fdcbd556413e52ee (patch) | |
tree | 06c477f5b9f318d0c461d653f490d2c467cefec4 /src/audio_core/stream.cpp | |
parent | Merge pull request #1306 from bunnei/fix-b5g6r5u (diff) | |
parent | audio_core: Flush stream when not playing anything (diff) | |
download | yuzu-926dd415871a8c38605678f2fdcbd556413e52ee.tar yuzu-926dd415871a8c38605678f2fdcbd556413e52ee.tar.gz yuzu-926dd415871a8c38605678f2fdcbd556413e52ee.tar.bz2 yuzu-926dd415871a8c38605678f2fdcbd556413e52ee.tar.lz yuzu-926dd415871a8c38605678f2fdcbd556413e52ee.tar.xz yuzu-926dd415871a8c38605678f2fdcbd556413e52ee.tar.zst yuzu-926dd415871a8c38605678f2fdcbd556413e52ee.zip |
Diffstat (limited to 'src/audio_core/stream.cpp')
-rw-r--r-- | src/audio_core/stream.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/audio_core/stream.cpp b/src/audio_core/stream.cpp index dbae75d8c..84dcdd98d 100644 --- a/src/audio_core/stream.cpp +++ b/src/audio_core/stream.cpp @@ -73,6 +73,7 @@ static void VolumeAdjustSamples(std::vector<s16>& samples) { void Stream::PlayNextBuffer() { if (!IsPlaying()) { // Ensure we are in playing state before playing the next buffer + sink_stream.Flush(); return; } @@ -83,6 +84,7 @@ void Stream::PlayNextBuffer() { if (queued_buffers.empty()) { // No queued buffers - we are effectively paused + sink_stream.Flush(); return; } @@ -90,6 +92,7 @@ void Stream::PlayNextBuffer() { queued_buffers.pop(); VolumeAdjustSamples(active_buffer->Samples()); + sink_stream.EnqueueSamples(GetNumChannels(), active_buffer->GetSamples()); CoreTiming::ScheduleEventThreadsafe(GetBufferReleaseCycles(*active_buffer), release_event, {}); |