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

Commit ba04dbe7 authored by Andy Hung's avatar Andy Hung
Browse files

SoundPool: Fix stream playback thread startup wait

Test: see bug for details, verified by logcat and sound analysis
Test: SoundPool(Aac|Haptic|Midi|Ogg)Test
Bug: 151781575
Change-Id: Iba65953cdfa4ab1cabc33650790e9fd5a2787786
parent 6051bff9
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -340,8 +340,10 @@ void StreamManager::run(int32_t id)
    int64_t waitTimeNs = kWaitTimeBeforeCloseNs;
    std::unique_lock lock(mStreamManagerLock);
    while (!mQuit) {
        if (mRestartStreams.empty()) { // on thread start, mRestartStreams can be non-empty.
            mStreamManagerCondition.wait_for(
                    lock, std::chrono::duration<int64_t, std::nano>(waitTimeNs));
        }
        ALOGV("%s(%d) awake", __func__, id);

        sanityCheckQueue_l();