Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8823c98a authored by Andy Hung's avatar Andy Hung
Browse files

Revert "Revert "SoundPool: Use caller thread for sound playback""

This reverts commit af018345.

Reason for revert: Further testing indicates there is no regression from the original state before October 23. See bug for more details on testing performed.

Change-Id: Idba0a01621243ab17e9ef607aec75af2c8db2f25
Test: forrest test on builds 5960785 and 5960803 perfetto_system#ion-avg
Bug: 145834064
parent af018345
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -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 = false;
static constexpr bool kPlayOnCallingThread = true;

// Amount of time for a StreamManager thread to wait before closing.
static constexpr int64_t kWaitTimeBeforeCloseNs = 9 * NANOS_PER_SECOND;
@@ -167,6 +167,7 @@ int32_t StreamManager::queueForPlay(const std::shared_ptr<Sound> &sound,
                if (!stream->getPairStream()->hasSound()) {
                    if (stream->getSoundID() == soundID) {
                        newStream = stream;
                        fromAvailableQueue = false;
                        break;
                    } else if (newStream == nullptr) {
                        newStream = stream;