mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 20:47:45 +00:00
AudioServer: Dequeue all buffers when clearing a ClientAudioStream
Previously we would exit the dequeuing loop after just one buffer had been dequeued due to some bogus logic. This would manifest when stopping and starting a track in SoundPlayer, where a few miliseconds of 'old' audio would play when restarting the playback. This commit makes sure we clear the entire queue.
This commit is contained in:
parent
23bc306f99
commit
42e118e6a9
1 changed files with 1 additions and 1 deletions
|
@ -78,7 +78,7 @@ public:
|
||||||
ErrorOr<Array<Audio::Sample, Audio::AUDIO_BUFFER_SIZE>, Audio::AudioQueue::QueueStatus> result = Audio::AudioQueue::QueueStatus::Invalid;
|
ErrorOr<Array<Audio::Sample, Audio::AUDIO_BUFFER_SIZE>, Audio::AudioQueue::QueueStatus> result = Audio::AudioQueue::QueueStatus::Invalid;
|
||||||
do {
|
do {
|
||||||
result = m_buffer->dequeue();
|
result = m_buffer->dequeue();
|
||||||
} while (result.is_error() && result.error() != Audio::AudioQueue::QueueStatus::Empty);
|
} while (!result.is_error() || result.error() != Audio::AudioQueue::QueueStatus::Empty);
|
||||||
}
|
}
|
||||||
|
|
||||||
void set_paused(bool paused) { m_paused = paused; }
|
void set_paused(bool paused) { m_paused = paused; }
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue