Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 568993f1 authored by Eric Laurent's avatar Eric Laurent Committed by Gerrit Code Review
Browse files

Merge "audio: update mOldTs.tv_nsec when mSleepNs > 0." into main

parents adf2d546 b61ef752
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -54,6 +54,13 @@ bool FastThread::threadLoop()
        // either nanosleep, sched_yield, or busy wait
        if (mSleepNs >= 0) {
            if (mSleepNs > 0) {
                if (mOldTsValid) {
                    mOldTs.tv_nsec += mSleepNs;
                    if (mOldTs.tv_nsec >= 1000000000) {
                        mOldTs.tv_sec++;
                        mOldTs.tv_nsec -= 1000000000;
                    }
                }
                ALOG_ASSERT(mSleepNs < 1000000000);
                const struct timespec req = {
                    0, // tv_sec