From af018345e56b18fcc617c04b3b9a55ac9b548b7f Mon Sep 17 00:00:00 2001 From: Deepika Likhite Date: Sat, 7 Dec 2019 00:01:06 +0000 Subject: [PATCH] Revert "SoundPool: Use caller thread for sound playback" This reverts commit 66262b16fb169676d768a8be52485881ea53da54. Reason for revert: < CL will be reverted since we are seeing a memory regression. Please refer this bug http://b/145834064. Exempt-From-Owner-Approval: see go/perf-revert-firs> Change-Id: I42db74b5e65f6cdc88d69bfbb686c93620ee563c --- media/jni/soundpool/StreamManager.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/media/jni/soundpool/StreamManager.cpp b/media/jni/soundpool/StreamManager.cpp index 64f81d5c34fbb..8928c47cf4bb2 100644 --- a/media/jni/soundpool/StreamManager.cpp +++ b/media/jni/soundpool/StreamManager.cpp @@ -38,7 +38,7 @@ static constexpr bool kStealActiveStream_OldestFirst = true; // kPlayOnCallingThread = true prior to R. // Changing to false means calls to play() are almost instantaneous instead of taking around // ~10ms to launch the AudioTrack. It is perhaps 100x faster. -static constexpr bool kPlayOnCallingThread = true; +static constexpr bool kPlayOnCallingThread = false; // Amount of time for a StreamManager thread to wait before closing. static constexpr int64_t kWaitTimeBeforeCloseNs = 9 * NANOS_PER_SECOND; @@ -167,7 +167,6 @@ int32_t StreamManager::queueForPlay(const std::shared_ptr &sound, if (!stream->getPairStream()->hasSound()) { if (stream->getSoundID() == soundID) { newStream = stream; - fromAvailableQueue = false; break; } else if (newStream == nullptr) { newStream = stream;