summaryrefslogtreecommitdiffstats
path: root/media/libmedia/AudioTrack.cpp
diff options
context:
space:
mode:
authorEric Laurent <elaurent@google.com>2014-01-27 18:13:39 -0800
committerEric Laurent <elaurent@google.com>2014-01-27 18:13:39 -0800
commitdf576995a5aad3428aeeef765387d650945c161d (patch)
tree51ee9bf8e0ac8b559547d4b12cd531ac037ae0e7 /media/libmedia/AudioTrack.cpp
parentb2b9b2dbdbc0445080d3c2d15212a43ba1f9cff1 (diff)
downloadframeworks_av-df576995a5aad3428aeeef765387d650945c161d.zip
frameworks_av-df576995a5aad3428aeeef765387d650945c161d.tar.gz
frameworks_av-df576995a5aad3428aeeef765387d650945c161d.tar.bz2
AudioTrack: fix obtainBuffer timeout calculation
AudioTrack::obtainBuffer() passes a pointer to a timeout variable that has gone out of scope when calling ClientProxy::obtainBuffer(). Same fix for AudioRecord. Bug: 11968591. Change-Id: I22af8f94fa2f8cc54ab5c25c89167c805e754317
Diffstat (limited to 'media/libmedia/AudioTrack.cpp')
-rw-r--r--media/libmedia/AudioTrack.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/media/libmedia/AudioTrack.cpp b/media/libmedia/AudioTrack.cpp
index f61a265..cfd79bc 100644
--- a/media/libmedia/AudioTrack.cpp
+++ b/media/libmedia/AudioTrack.cpp
@@ -1133,13 +1133,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;