summaryrefslogtreecommitdiff
path: root/src/audio_core
diff options
context:
space:
mode:
authorGravatar bunnei2021-01-28 21:54:46 -0800
committerGravatar GitHub2021-01-28 21:54:46 -0800
commitb786568c5ae056f2d55854959029e72e58d62990 (patch)
treeccc2f2069e0d53e72d3f717b7598c2ae99e17d09 /src/audio_core
parentMerge pull request #5837 from german77/socketstub (diff)
parentaudout: FlushAudioOutBuffers (diff)
downloadyuzu-b786568c5ae056f2d55854959029e72e58d62990.tar.gz
yuzu-b786568c5ae056f2d55854959029e72e58d62990.tar.xz
yuzu-b786568c5ae056f2d55854959029e72e58d62990.zip
Merge pull request #5809 from ogniK5377/FlushAudioOutBuffers
audout: FlushAudioOutBuffers
Diffstat (limited to 'src/audio_core')
-rw-r--r--src/audio_core/stream.cpp8
-rw-r--r--src/audio_core/stream.h3
2 files changed, 11 insertions, 0 deletions
diff --git a/src/audio_core/stream.cpp b/src/audio_core/stream.cpp
index afe68c9ed..5b0b285cd 100644
--- a/src/audio_core/stream.cpp
+++ b/src/audio_core/stream.cpp
@@ -51,6 +51,14 @@ void Stream::Stop() {
51 UNIMPLEMENTED(); 51 UNIMPLEMENTED();
52} 52}
53 53
54bool Stream::Flush() {
55 const bool had_buffers = !queued_buffers.empty();
56 while (!queued_buffers.empty()) {
57 queued_buffers.pop();
58 }
59 return had_buffers;
60}
61
54void Stream::SetVolume(float volume) { 62void Stream::SetVolume(float volume) {
55 game_volume = volume; 63 game_volume = volume;
56} 64}
diff --git a/src/audio_core/stream.h b/src/audio_core/stream.h
index 506ac536b..559844b9b 100644
--- a/src/audio_core/stream.h
+++ b/src/audio_core/stream.h
@@ -56,6 +56,9 @@ public:
56 /// Queues a buffer into the audio stream, returns true on success 56 /// Queues a buffer into the audio stream, returns true on success
57 bool QueueBuffer(BufferPtr&& buffer); 57 bool QueueBuffer(BufferPtr&& buffer);
58 58
59 /// Flush audio buffers
60 bool Flush();
61
59 /// Returns true if the audio stream contains a buffer with the specified tag 62 /// Returns true if the audio stream contains a buffer with the specified tag
60 [[nodiscard]] bool ContainsBuffer(Buffer::Tag tag) const; 63 [[nodiscard]] bool ContainsBuffer(Buffer::Tag tag) const;
61 64