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

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

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

* commit '25a86930':
  AudioTrack: fix obtainBuffer timeout calculation
parents 44130bf5 25a86930
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
@@ -1107,13 +1107,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;