diff options
author | James Dong <jdong@google.com> | 2011-04-04 14:42:05 -0700 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2011-04-04 14:42:05 -0700 |
commit | b0ccbacdb35e8e987eb9efd61af13fefd7c2f5f0 (patch) | |
tree | d9acfe03ae0b4e4b2b58192b51843317f3395a33 /media/libstagefright | |
parent | b7a76e84fde7fe534d46aaaa71e3224798354009 (diff) | |
parent | ea5d2c584490424be6bbc27dec58b4f9868d631e (diff) | |
download | frameworks_base-b0ccbacdb35e8e987eb9efd61af13fefd7c2f5f0.zip frameworks_base-b0ccbacdb35e8e987eb9efd61af13fefd7c2f5f0.tar.gz frameworks_base-b0ccbacdb35e8e987eb9efd61af13fefd7c2f5f0.tar.bz2 |
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.
Diffstat (limited to 'media/libstagefright')
-rw-r--r-- | media/libstagefright/AudioSource.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/media/libstagefright/AudioSource.cpp b/media/libstagefright/AudioSource.cpp index 29f16d8..a84365f 100644 --- a/media/libstagefright/AudioSource.cpp +++ b/media/libstagefright/AudioSource.cpp @@ -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; |