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

Commit b5052662 authored by Treehugger Robot's avatar Treehugger Robot Committed by Automerger Merge Worker
Browse files

Merge "aaudio: fix command thread busy loop." am: 90f4e746

parents c30a9096 90f4e746
Loading
Loading
Loading
Loading
+9 −1
Original line number Diff line number Diff line
@@ -435,7 +435,15 @@ void AAudioServiceStreamBase::run() {
            }
        }
        if (isIdle_l() && AudioClock::getNanoseconds() >= standbyTime) {
            standby_l();
            aaudio_result_t result = standby_l();
            if (result != AAUDIO_OK) {
                // If standby failed because of the function is not implemented, there is no
                // need to retry. Otherwise, retry standby later.
                ALOGW("Failed to enter standby, error=%d", result);
                standbyTime = result == AAUDIO_ERROR_UNIMPLEMENTED
                        ? std::numeric_limits<int64_t>::max()
                        : AudioClock::getNanoseconds() + IDLE_TIMEOUT_NANOS;
            }
        }

        if (command != nullptr) {
+1 −1
Original line number Diff line number Diff line
@@ -320,7 +320,7 @@ protected:
    }

    virtual aaudio_result_t standby_l() REQUIRES(mLock) {
        return AAUDIO_ERROR_UNAVAILABLE;
        return AAUDIO_ERROR_UNIMPLEMENTED;
    }
    class ExitStandbyParam : public AAudioCommandParam {
    public: