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

Commit 9a03bfb0 authored by James Dong's avatar James Dong Committed by Android Git Automerger
Browse files

am ea5d2c58: Merge "When read() from AudioRecord returns 0 or negative value,...

am ea5d2c58: Merge "When read() from AudioRecord returns 0 or negative value, report an error to application. DO NOT MERGE." into gingerbread

* commit 'ea5d2c584490424be6bbc27dec58b4f9868d631e':
  When read() from AudioRecord returns 0 or negative value, report an error to application. DO NOT MERGE.
parents c0995cd9 90fd5e0e
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -287,9 +287,10 @@ status_t AudioSource::read(
        }

        ssize_t n = mRecord->read(buffer->data(), buffer->size());
        if (n < 0) {
        if (n <= 0) {
            LOGE("Read from AudioRecord returns: %ld", n);
            buffer->release();
            return (status_t)n;
            return UNKNOWN_ERROR;
        }

        int64_t recordDurationUs = (1000000LL * n >> 1) / sampleRate;