Merge "Audioflinger: adjust wait time for duplicating thread" into main
diff --git a/services/audioflinger/Threads.cpp b/services/audioflinger/Threads.cpp
index 58f2dcf..ad48517 100644
--- a/services/audioflinger/Threads.cpp
+++ b/services/audioflinger/Threads.cpp
@@ -7866,7 +7866,8 @@
// caller must hold mutex()
void DuplicatingThread::updateWaitTime_l()
{
- mWaitTimeMs = UINT_MAX;
+ // Initialize mWaitTimeMs according to the mixer buffer size.
+ mWaitTimeMs = mNormalFrameCount * 2 * 1000 / mSampleRate;
for (size_t i = 0; i < mOutputTracks.size(); i++) {
const auto strong = mOutputTracks[i]->thread().promote();
if (strong != 0) {