Keep a copy of most recent audio played
Change-Id: I6b2f97881c39998a2fae9ab79d669af6c0a37e94
diff --git a/services/audioflinger/PipeReader.cpp b/services/audioflinger/PipeReader.cpp
index 43bcb42..df3ee04 100644
--- a/services/audioflinger/PipeReader.cpp
+++ b/services/audioflinger/PipeReader.cpp
@@ -49,9 +49,9 @@
// read() is not multi-thread safe w.r.t. itself, so no mutex or atomic op needed to read mFront
size_t avail = rear - mFront;
if (CC_UNLIKELY(avail > mPipe.mMaxFrames)) {
- // Discard all but 3/4 of the most recent data in pipe to avoid another overrun immediately
+ // Discard 1/16 of the most recent data in pipe to avoid another overrun immediately
int32_t oldFront = mFront;
- mFront = rear - mPipe.mMaxFrames + (mPipe.mMaxFrames >> 2);
+ mFront = rear - mPipe.mMaxFrames + (mPipe.mMaxFrames >> 4);
mFramesOverrun += (size_t) (mFront - oldFront);
++mOverruns;
return OVERRUN;