AudioTrack: fix stall if setBufferSizeInFrames() called before play()
The server was waiting for a full buffer.
But the buffer was only getting partly filled.
So the stream was not starting.
The fix involves having the server look at the adjustable threshold.
Bug: 27505889
Change-Id: I5dbf686413e670dacbbecc9e0f838744e465f44f
Signed-off-by: Phil Burk <philburk@google.com>
diff --git a/services/audioflinger/Tracks.cpp b/services/audioflinger/Tracks.cpp
index 8b49062..a75ca77 100644
--- a/services/audioflinger/Tracks.cpp
+++ b/services/audioflinger/Tracks.cpp
@@ -617,7 +617,7 @@
return true;
}
- if (framesReady() >= mFrameCount ||
+ if (framesReady() >= mServerProxy->getBufferSizeInFrames() ||
(mCblk->mFlags & CBLK_FORCEREADY)) {
mFillingUpStatus = FS_FILLED;
android_atomic_and(~CBLK_FORCEREADY, &mCblk->mFlags);