From 7db7df0e8d9d7cee8ba374468cdbfa0108e3337c Mon Sep 17 00:00:00 2001 From: Glenn Kasten Date: Tue, 25 Jun 2013 16:13:23 -0700 Subject: AudioTrackShared cleanup Maintain unreleased frame count on client side also (was already there on server side). Assertion failure instead of BAD_VALUE status for incorrect usage of APIs. Clean up error handling code. Change-Id: I23ca2f6f8a7c18645309ee5d64fbc844429bcba8 --- include/private/media/AudioTrackShared.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'include/private') diff --git a/include/private/media/AudioTrackShared.h b/include/private/media/AudioTrackShared.h index b41684a..0592683 100644 --- a/include/private/media/AudioTrackShared.h +++ b/include/private/media/AudioTrackShared.h @@ -168,6 +168,7 @@ protected: const bool mIsOut; // true for AudioTrack, false for AudioRecord const bool mClientInServer; // true for OutputTrack, false for AudioTrack & AudioRecord bool mIsShutdown; // latch set to true when shared memory corruption detected + size_t mUnreleased; // unreleased frames remaining from most recent obtainBuffer }; // ---------------------------------------------------------------------------- @@ -213,7 +214,7 @@ public: // DEAD_OBJECT Server has died or invalidated, caller should destroy this proxy and re-create. // -EINTR Call has been interrupted. Look around to see why, and then perhaps try again. // NO_INIT Shared memory is corrupt. - // BAD_VALUE On entry buffer == NULL or buffer->mFrameCount == 0. + // Assertion failure on entry, if buffer == NULL or buffer->mFrameCount == 0. status_t obtainBuffer(Buffer* buffer, const struct timespec *requested = NULL, struct timespec *elapsed = NULL); @@ -372,7 +373,6 @@ public: virtual void releaseBuffer(Buffer* buffer); protected: - size_t mUnreleased; // unreleased frames remaining from most recent obtainBuffer() size_t mAvailToClient; // estimated frames available to client prior to releaseBuffer() private: int32_t mFlush; // our copy of cblk->u.mStreaming.mFlush, for streaming output only -- cgit v1.1