diff options
author | Jean-Michel Trivi <jmtrivi@google.com> | 2014-03-11 17:12:36 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2014-03-11 17:12:37 +0000 |
commit | c644345b0b8f5292a049c4cee2bb7a2a6159b884 (patch) | |
tree | 423a2a937e693746189cf51852d0e727c418471b /media/libmedia | |
parent | 1ac1638077277de52d1dd4c54db71e67753f1960 (diff) | |
parent | 720ad9ddb2ac6b55b0dfbfcd2d8360151d8ac427 (diff) | |
download | frameworks_av-c644345b0b8f5292a049c4cee2bb7a2a6159b884.zip frameworks_av-c644345b0b8f5292a049c4cee2bb7a2a6159b884.tar.gz frameworks_av-c644345b0b8f5292a049c4cee2bb7a2a6159b884.tar.bz2 |
Merge "AudioTrack non-blocking write"
Diffstat (limited to 'media/libmedia')
-rw-r--r-- | media/libmedia/AudioTrack.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/media/libmedia/AudioTrack.cpp b/media/libmedia/AudioTrack.cpp index ae47201..60ed626 100644 --- a/media/libmedia/AudioTrack.cpp +++ b/media/libmedia/AudioTrack.cpp @@ -1291,7 +1291,7 @@ void AudioTrack::releaseBuffer(Buffer* audioBuffer) // ------------------------------------------------------------------------- -ssize_t AudioTrack::write(const void* buffer, size_t userSize) +ssize_t AudioTrack::write(const void* buffer, size_t userSize, bool blocking) { if (mTransfer != TRANSFER_SYNC || mIsTimed) { return INVALID_OPERATION; @@ -1310,7 +1310,8 @@ ssize_t AudioTrack::write(const void* buffer, size_t userSize) while (userSize >= mFrameSize) { audioBuffer.frameCount = userSize / mFrameSize; - status_t err = obtainBuffer(&audioBuffer, &ClientProxy::kForever); + status_t err = obtainBuffer(&audioBuffer, + blocking ? &ClientProxy::kForever : &ClientProxy::kNonBlocking); if (err < 0) { if (written > 0) { break; |