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

Commit fb7df2c3 authored by Andy Hung's avatar Andy Hung
Browse files

Fix periodic notification timing error for AudioRecord

Change-Id: I768d8a30c6845372ad7c306ed1bc0ec030ae1804
parent 1a86a8ad
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.