summaryrefslogtreecommitdiffstats
path: root/media/libmedia
diff options
context:
space:
mode:
authorGlenn Kasten <gkasten@google.com>2013-10-18 22:02:46 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2013-10-18 22:02:47 +0000
commit95c03858e2ab4fb693a2bfe47b3caa806e43c044 (patch)
treef872e4b7570cf2f431cca474e47d9d10c6cbed66 /media/libmedia
parent6a51d7ed7062536ccc892c8850a34ed55cbc8d5c (diff)
parent2e422c472c91aa7912befd0fc038d1e11f354bc1 (diff)
downloadframeworks_av-95c03858e2ab4fb693a2bfe47b3caa806e43c044.zip
frameworks_av-95c03858e2ab4fb693a2bfe47b3caa806e43c044.tar.gz
frameworks_av-95c03858e2ab4fb693a2bfe47b3caa806e43c044.tar.bz2
Merge "Allow releaseBuffer after flush" into klp-dev
Diffstat (limited to 'media/libmedia')
-rw-r--r--media/libmedia/AudioTrackShared.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/media/libmedia/AudioTrackShared.cpp b/media/libmedia/AudioTrackShared.cpp
index da73d65..caa7900 100644
--- a/media/libmedia/AudioTrackShared.cpp
+++ b/media/libmedia/AudioTrackShared.cpp
@@ -506,7 +506,7 @@ ServerProxy::ServerProxy(audio_track_cblk_t* cblk, void *buffers, size_t frameCo
{
}
-status_t ServerProxy::obtainBuffer(Buffer* buffer)
+status_t ServerProxy::obtainBuffer(Buffer* buffer, bool ackFlush)
{
LOG_ALWAYS_FATAL_IF(buffer == NULL || buffer->mFrameCount == 0);
if (mIsShutdown) {
@@ -579,7 +579,11 @@ status_t ServerProxy::obtainBuffer(Buffer* buffer)
buffer->mRaw = part1 > 0 ?
&((char *) mBuffers)[(mIsOut ? front : rear) * mFrameSize] : NULL;
buffer->mNonContig = availToServer - part1;
- mUnreleased = part1;
+ // After flush(), allow releaseBuffer() on a previously obtained buffer;
+ // see "Acknowledge any pending flush()" in audioflinger/Tracks.cpp.
+ if (!ackFlush) {
+ mUnreleased = part1;
+ }
return part1 > 0 ? NO_ERROR : WOULD_BLOCK;
}
no_init:
@@ -761,7 +765,7 @@ ssize_t StaticAudioTrackServerProxy::pollPosition()
return (ssize_t) position;
}
-status_t StaticAudioTrackServerProxy::obtainBuffer(Buffer* buffer)
+status_t StaticAudioTrackServerProxy::obtainBuffer(Buffer* buffer, bool ackFlush)
{
if (mIsShutdown) {
buffer->mFrameCount = 0;