summaryrefslogtreecommitdiffstats
path: root/media/libmedia
diff options
context:
space:
mode:
authorGlenn Kasten <gkasten@google.com>2015-10-14 01:11:07 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2015-10-14 01:11:07 +0000
commit8fa0848cd47882d6df0c584b276515f98b768eca (patch)
tree4d86c411c2d8e8fed10dfd9a0723e6b4189d9b25 /media/libmedia
parentce805c2a0c447dcdd4e649db7415020dbec1100b (diff)
parent954ca45ac30539a49f179580b667b0ab1056d113 (diff)
downloadframeworks_av-8fa0848cd47882d6df0c584b276515f98b768eca.zip
frameworks_av-8fa0848cd47882d6df0c584b276515f98b768eca.tar.gz
frameworks_av-8fa0848cd47882d6df0c584b276515f98b768eca.tar.bz2
Merge "For static obtainBuffer(), do not set mUnreleased if acknowledging flush." into mnc-dr-dev
Diffstat (limited to 'media/libmedia')
-rw-r--r--media/libmedia/AudioTrackShared.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/media/libmedia/AudioTrackShared.cpp b/media/libmedia/AudioTrackShared.cpp
index 6a51a76..caa84fb 100644
--- a/media/libmedia/AudioTrackShared.cpp
+++ b/media/libmedia/AudioTrackShared.cpp
@@ -932,7 +932,7 @@ ssize_t StaticAudioTrackServerProxy::pollPosition()
return (ssize_t) mState.mPosition;
}
-status_t StaticAudioTrackServerProxy::obtainBuffer(Buffer* buffer, bool ackFlush __unused)
+status_t StaticAudioTrackServerProxy::obtainBuffer(Buffer* buffer, bool ackFlush)
{
if (mIsShutdown) {
buffer->mFrameCount = 0;
@@ -970,7 +970,9 @@ status_t StaticAudioTrackServerProxy::obtainBuffer(Buffer* buffer, bool ackFlush
// it is always larger or equal to avail.
LOG_ALWAYS_FATAL_IF(mFramesReady < (int64_t) avail);
buffer->mNonContig = mFramesReady == INT64_MAX ? SIZE_MAX : clampToSize(mFramesReady - avail);
- mUnreleased = avail;
+ if (!ackFlush) {
+ mUnreleased = avail;
+ }
return NO_ERROR;
}