Add AudioRecord timestamps
Bug: 13569372
Bug: 22886739
Change-Id: Ibc81afefb733d23676a632a0f2da31163fdbe05f
diff --git a/media/libmedia/AudioTrackShared.cpp b/media/libmedia/AudioTrackShared.cpp
index d75ad87..988386e 100644
--- a/media/libmedia/AudioTrackShared.cpp
+++ b/media/libmedia/AudioTrackShared.cpp
@@ -597,7 +597,7 @@
ServerProxy::ServerProxy(audio_track_cblk_t* cblk, void *buffers, size_t frameCount,
size_t frameSize, bool isOut, bool clientInServer)
: Proxy(cblk, buffers, frameCount, frameSize, isOut, clientInServer),
- mAvailToClient(0), mFlush(0)
+ mAvailToClient(0), mFlush(0), mReleased(0)
{
}
@@ -733,6 +733,7 @@
}
cblk->mServer += stepCount;
+ mReleased += stepCount;
size_t half = mFrameCount / 2;
if (half == 0) {
@@ -1033,6 +1034,8 @@
mFramesReadySafe = clampToSize(mFramesReady);
cblk->mServer += stepCount;
+ mReleased += stepCount;
+
// This may overflow, but client is not supposed to rely on it
StaticAudioTrackPosLoop posLoop;
posLoop.mBufferPosition = mState.mPosition;