diff options
author | Eric Laurent <elaurent@google.com> | 2014-03-05 23:54:00 +0000 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2014-03-05 23:54:00 +0000 |
commit | c1e06f692cf16a8c9f5ae921ab4d642f7a082877 (patch) | |
tree | f08061b883bc7f4e2d67f1c62b9eceddb2557fc2 /media/libmedia | |
parent | 5d3e310a847d090b7f79554154d25c70be8fd594 (diff) | |
parent | 09e45992067f03a05f82400a6cacf16bb8018f16 (diff) | |
download | frameworks_av-c1e06f692cf16a8c9f5ae921ab4d642f7a082877.zip frameworks_av-c1e06f692cf16a8c9f5ae921ab4d642f7a082877.tar.gz frameworks_av-c1e06f692cf16a8c9f5ae921ab4d642f7a082877.tar.bz2 |
am 09e45992: am 25a86930: am 88876fb4: AudioTrack: fix obtainBuffer timeout calculation
* commit '09e45992067f03a05f82400a6cacf16bb8018f16':
AudioTrack: fix obtainBuffer timeout calculation
Diffstat (limited to 'media/libmedia')
-rw-r--r-- | media/libmedia/AudioRecord.cpp | 2 | ||||
-rw-r--r-- | media/libmedia/AudioTrack.cpp | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/media/libmedia/AudioRecord.cpp b/media/libmedia/AudioRecord.cpp index 666fafa..ccbc5a3 100644 --- a/media/libmedia/AudioRecord.cpp +++ b/media/libmedia/AudioRecord.cpp @@ -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; diff --git a/media/libmedia/AudioTrack.cpp b/media/libmedia/AudioTrack.cpp index a9d6993..772612a 100644 --- a/media/libmedia/AudioTrack.cpp +++ b/media/libmedia/AudioTrack.cpp @@ -1113,13 +1113,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; |