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

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

Merge "Fix periodic notification timing error for AudioRecord"

parents a1a847a5 fb7df2c3
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -863,8 +863,11 @@ nsecs_t AudioRecord::processAudioBuffer()
    if (!markerReached && position < markerPosition) {
        minFrames = markerPosition - position;
    }
    if (updatePeriod > 0 && updatePeriod < minFrames) {
        minFrames = updatePeriod;
    if (updatePeriod > 0) {
        uint32_t remaining = newPosition - position;
        if (remaining < minFrames) {
            minFrames = remaining;
        }
    }

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