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

Commit 183eb5fb authored by Andy Hung's avatar Andy Hung Committed by Android (Google) Code Review
Browse files

Merge "Fix PatchTrack retry for ClientProxy::obtainBuffer" into pi-dev

parents cca23778 f62e1a28
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -1571,9 +1571,11 @@ status_t AudioFlinger::PlaybackThread::PatchTrack::obtainBuffer(Proxy::Buffer* b
    status_t status = NO_ERROR;
    static const int32_t kMaxTries = 5;
    int32_t tryCounter = kMaxTries;
    const size_t originalFrameCount = buffer->mFrameCount;
    do {
        if (status == NOT_ENOUGH_DATA) {
            restartIfDisabled();
            buffer->mFrameCount = originalFrameCount; // cleared on error, must be restored.
        }
        status = mProxy->obtainBuffer(buffer, timeOut);
    } while ((status == NOT_ENOUGH_DATA) && (tryCounter-- > 0));