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

Commit 151117ec authored by Andy Hung's avatar Andy Hung
Browse files

SoundPool: Update queue only if streamID matches

SoundPool API commands are based on an atomic
compare-StreamID if match then operate (see compare-exchange).

Test: soundpool_stress
Test: atest SoundPoolAacTest
Test: atest SoundPoolHapticTest
Test: atest SoundPoolMidiTest
Test: atest SoundPoolOggTest
Bug: 201233890
Bug: 201262390
Change-Id: I63cc07d581a0ac1d5440852bfe0c75edc9d73e75
parent 8d221843
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -185,7 +185,7 @@ void SoundPool::stop(int32_t streamID)
    auto apiLock = kUseApiLock ? std::make_unique<std::lock_guard<std::mutex>>(mApiLock) : nullptr;
    soundpool::Stream* stream = mStreamManager.findStream(streamID);
    if (stream != nullptr && stream->requestStop(streamID)) {
        mStreamManager.moveToRestartQueue(stream);
        mStreamManager.moveToRestartQueue(stream, streamID);
    }
}