summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorGlenn Kasten <gkasten@google.com>2013-10-18 13:00:29 -0700
committerGlenn Kasten <gkasten@google.com>2013-10-18 13:53:41 -0700
commit2e422c472c91aa7912befd0fc038d1e11f354bc1 (patch)
tree7583e04f353f9cadf5081fafdcb8042450e3c85c /include
parentdedc7b0fa23c21b525dc8abb572bb8161ad66a9b (diff)
downloadframeworks_av-2e422c472c91aa7912befd0fc038d1e11f354bc1.zip
frameworks_av-2e422c472c91aa7912befd0fc038d1e11f354bc1.tar.gz
frameworks_av-2e422c472c91aa7912befd0fc038d1e11f354bc1.tar.bz2
Allow releaseBuffer after flush
After AudioTrack start checks for pending flush, allow releaseBuffer on any previously obtained buffer. For example, this can happen if the resampler has obtained a buffer but not released the whole buffer yet. Note that the resampler will be reading obsolete data. Bug: 11285590 Change-Id: I0614fbb62e43604aac3089cce4b7797c87a306b5
Diffstat (limited to 'include')
-rw-r--r--include/private/media/AudioTrackShared.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/include/private/media/AudioTrackShared.h b/include/private/media/AudioTrackShared.h
index 395f164..7fd9379 100644
--- a/include/private/media/AudioTrackShared.h
+++ b/include/private/media/AudioTrackShared.h
@@ -360,6 +360,7 @@ public:
// which must be > 0.
// buffer->mNonContig is unused.
// buffer->mRaw is unused.
+ // ackFlush is true iff being called from Track::start to acknowledge a pending flush.
// On exit:
// buffer->mFrameCount has the actual number of contiguous available frames,
// which is always 0 when the return status != NO_ERROR.
@@ -370,7 +371,7 @@ public:
// NO_ERROR Success, buffer->mFrameCount > 0.
// WOULD_BLOCK No frames are available.
// NO_INIT Shared memory is corrupt.
- virtual status_t obtainBuffer(Buffer* buffer);
+ virtual status_t obtainBuffer(Buffer* buffer, bool ackFlush = false);
// Release (some of) the frames last obtained.
// On entry, buffer->mFrameCount should have the number of frames to release,
@@ -437,7 +438,7 @@ protected:
public:
virtual size_t framesReady();
virtual void framesReadyIsCalledByMultipleThreads();
- virtual status_t obtainBuffer(Buffer* buffer);
+ virtual status_t obtainBuffer(Buffer* buffer, bool ackFlush);
virtual void releaseBuffer(Buffer* buffer);
virtual void tallyUnderrunFrames(uint32_t frameCount);
virtual uint32_t getUnderrunFrames() const { return 0; }