OSDN Git Service
(root)
/
android-x86
/
frameworks-base.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
7544b23
)
When read() from AudioRecord returns 0 or negative value, report an error to applicat...
author
James Dong
<jdong@google.com>
Wed, 30 Mar 2011 23:04:09 +0000
(16:04 -0700)
committer
James Dong
<jdong@google.com>
Wed, 30 Mar 2011 23:30:00 +0000
(16:30 -0700)
Change-Id: I3a66fd0ed3f6b90350d706a608a39d8b4a398e32
related-to-bug:
4195127
media/libstagefright/AudioSource.cpp
patch
|
blob
|
history
diff --git
a/media/libstagefright/AudioSource.cpp
b/media/libstagefright/AudioSource.cpp
index
29f16d8
..
a84365f
100644
(file)
--- 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;