mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 14:47:44 +00:00
Piano: Increase AudioPlayerLoop resilience against scheduling weirdness
This is a temporary fix until we move AudioPlayerLoop to direct buffer enqueuing.
This commit is contained in:
parent
4941cffdd0
commit
3123753e6b
1 changed files with 2 additions and 2 deletions
|
@ -31,12 +31,12 @@ AudioPlayerLoop::AudioPlayerLoop(TrackManager& track_manager, bool& need_to_writ
|
|||
// FIXME: I said I would never write such a hack again, but here we are.
|
||||
// This code should die as soon as possible anyways, so it doesn't matter.
|
||||
// Please don't use this as an example to write good audio code; it's just here as a temporary hack.
|
||||
Core::EventLoop::register_timer(*this, 10, true, Core::TimerShouldFireWhenNotVisible::Yes);
|
||||
Core::EventLoop::register_timer(*this, 5, true, Core::TimerShouldFireWhenNotVisible::Yes);
|
||||
}
|
||||
|
||||
void AudioPlayerLoop::timer_event(Core::TimerEvent&)
|
||||
{
|
||||
if (m_audio_client->remaining_samples() < sample_count)
|
||||
while (m_audio_client->remaining_samples() < sample_count)
|
||||
enqueue_audio();
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue