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

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

Merge "Fix cumulative error in setPositionNotificationPeriod"

parents 7da74b31 2d85f097
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -1746,10 +1746,11 @@ nsecs_t AudioTrack::processAudioBuffer()
        minFrames = markerPosition - position;
    }
    if (loopPeriod > 0 && loopPeriod < minFrames) {
        // loopPeriod is already adjusted for actual position.
        minFrames = loopPeriod;
    }
    if (updatePeriod > 0 && updatePeriod < minFrames) {
        minFrames = updatePeriod;
    if (updatePeriod > 0) {
        minFrames = min(minFrames, uint32_t(newPosition - position));
    }

    // If > 0, poll periodically to recover from a stuck server.  A good value is 2.