This commit is contained in:
wheremyfoodat 2025-03-18 13:14:51 +00:00 committed by GitHub
commit a3c5475732
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -85,7 +85,9 @@ namespace Audio {
// Run 1 slice of DSP instructions and schedule the next audio frame
void runAudioFrame(u64 eventTimestamp) override {
runSlice();
scheduler.addEvent(Scheduler::EventType::RunDSP, scheduler.currentTimestamp + Audio::lleSlice * 2);
// How many cycles we were late
const u64 cycleDrift = scheduler.currentTimestamp - eventTimestamp;
scheduler.addEvent(Scheduler::EventType::RunDSP, scheduler.currentTimestamp + Audio::lleSlice * 2 - cycleDrift);
}
void setAudioEnabled(bool enable) override;