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

Commit c1e06f69 authored by Eric Laurent's avatar Eric Laurent Committed by Android Git Automerger
Browse files

am 09e45992: am 25a86930: am 88876fb4: AudioTrack: fix obtainBuffer timeout calculation

* commit '09e45992':
  AudioTrack: fix obtainBuffer timeout calculation
parents 5d3e310a 09e45992
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -545,13 +545,13 @@ status_t AudioRecord::obtainBuffer(Buffer* audioBuffer, int32_t waitCount)
    }

    const struct timespec *requested;
    struct timespec timeout;
    if (waitCount == -1) {
        requested = &ClientProxy::kForever;
    } else if (waitCount == 0) {
        requested = &ClientProxy::kNonBlocking;
    } else if (waitCount > 0) {
        long long ms = WAIT_PERIOD_MS * (long long) waitCount;
        struct timespec timeout;
        timeout.tv_sec = ms / 1000;
        timeout.tv_nsec = (int) (ms % 1000) * 1000000;
        requested = &timeout;
+1 −1
Original line number Diff line number Diff line
@@ -1113,13 +1113,13 @@ status_t AudioTrack::obtainBuffer(Buffer* audioBuffer, int32_t waitCount)
    }

    const struct timespec *requested;
    struct timespec timeout;
    if (waitCount == -1) {
        requested = &ClientProxy::kForever;
    } else if (waitCount == 0) {
        requested = &ClientProxy::kNonBlocking;
    } else if (waitCount > 0) {
        long long ms = WAIT_PERIOD_MS * (long long) waitCount;
        struct timespec timeout;
        timeout.tv_sec = ms / 1000;
        timeout.tv_nsec = (int) (ms % 1000) * 1000000;
        requested = &timeout;