Reduce audio output latency
This patch reduces latency in the OpenSL ES player path by calling the
callback immediately before data is consumed, rather than after.
Bug: 12246268
Change-Id: I8273b4a03f16011beec21dd52545f8ad1a25fd95
diff --git a/src/itf/IBufferQueue.c b/src/itf/IBufferQueue.c
index 9503694..4e310b7 100644
--- a/src/itf/IBufferQueue.c
+++ b/src/itf/IBufferQueue.c
@@ -96,6 +96,7 @@
thiz->mState.count = 0;
thiz->mState.playIndex = 0;
thiz->mSizeConsumed = 0;
+ thiz->mCallbackPending = false;
}
}
#endif
@@ -185,6 +186,7 @@
thiz->mRear = NULL;
#ifdef ANDROID
thiz->mSizeConsumed = 0;
+ thiz->mCallbackPending = false;
#endif
BufferHeader *bufferHeader = thiz->mTypical;
unsigned i;