diff options
author | Eric Laurent <elaurent@google.com> | 2014-03-05 23:47:20 +0000 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2014-03-05 23:47:20 +0000 |
commit | 25a86930ac0ccf4750ad2fb0c2f5a4a122d24ecf (patch) | |
tree | ffc379029cf2e53932f46375efc61363fb0f1a6e /media/libmedia | |
parent | 994d9bad4c545cc8861e971f9dbcb4c061ee19ed (diff) | |
parent | 88876fb4eb8365343f2a9ca0e8f53148ca38b845 (diff) | |
download | frameworks_av-25a86930ac0ccf4750ad2fb0c2f5a4a122d24ecf.zip frameworks_av-25a86930ac0ccf4750ad2fb0c2f5a4a122d24ecf.tar.gz frameworks_av-25a86930ac0ccf4750ad2fb0c2f5a4a122d24ecf.tar.bz2 |
am 88876fb4: AudioTrack: fix obtainBuffer timeout calculation
* commit '88876fb4eb8365343f2a9ca0e8f53148ca38b845':
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 0609a22..11b0b89 100644 --- a/media/libmedia/AudioTrack.cpp +++ b/media/libmedia/AudioTrack.cpp @@ -1107,13 +1107,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; |