diff options
author | Glenn Kasten <gkasten@google.com> | 2012-09-28 12:22:52 -0700 |
---|---|---|
committer | Jean-Michel Trivi <jmtrivi@google.com> | 2012-09-28 16:30:52 -0700 |
commit | 003d9f71937070791418bf7efc1f7fe1e4c6b821 (patch) | |
tree | bcf8cd292f899525639d95d833cd0488cf32cf03 /media | |
parent | e646b2d26459ca30667097e9600ee3f57ebfd228 (diff) | |
download | frameworks_av-003d9f71937070791418bf7efc1f7fe1e4c6b821.zip frameworks_av-003d9f71937070791418bf7efc1f7fe1e4c6b821.tar.gz frameworks_av-003d9f71937070791418bf7efc1f7fe1e4c6b821.tar.bz2 |
Enable write side of MonoPipe to be shutdown
Bug: 7253033
Change-Id: Iea8390763b59ffa7a8e2a6b77dd04ea23442698f
Diffstat (limited to 'media')
-rw-r--r-- | media/libnbaio/MonoPipe.cpp | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/media/libnbaio/MonoPipe.cpp b/media/libnbaio/MonoPipe.cpp index bbdc8c1..e8d3d9b 100644 --- a/media/libnbaio/MonoPipe.cpp +++ b/media/libnbaio/MonoPipe.cpp @@ -41,7 +41,8 @@ MonoPipe::MonoPipe(size_t reqFrames, NBAIO_Format format, bool writeCanBlock) : mWriteTsValid(false), // mWriteTs mSetpoint((reqFrames * 11) / 16), - mWriteCanBlock(writeCanBlock) + mWriteCanBlock(writeCanBlock), + mIsShutdown(false) { CCHelper tmpHelper; status_t res; @@ -121,7 +122,7 @@ ssize_t MonoPipe::write(const void *buffer, size_t count) android_atomic_release_store(written + mRear, &mRear); totalFramesWritten += written; } - if (!mWriteCanBlock) { + if (!mWriteCanBlock || mIsShutdown) { break; } count -= written; @@ -299,4 +300,14 @@ int64_t MonoPipe::offsetTimestampByAudioFrames(int64_t ts, size_t audFrames) return ts + frame_lt_duration; } +void MonoPipe::shutdown(bool newState) +{ + mIsShutdown = newState; +} + +bool MonoPipe::isShutdown() +{ + return mIsShutdown; +} + } // namespace android |