This repository has been archived by the owner on Nov 8, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
SoundPool: Improve single stream SoundPool handling
By design, the StreamManager ramps down volume on a Stream stop to prevent pops and glitches. When the SoundPool is configured only with a single stream, there may be a short period of unavailability of that stream while stop is called by the worker thread; an immediate play after a stop may return 0 (failure). To allow immediate play after stop for a *single* Stream configured SoundPool, we lock the StreamManager worker thread so that the stop call is processed and the stream is visible to the client for use. We prefer not to keep this lock for the multiple Stream case as it prevents concurrent initiation of sounds from multiple StreamManager worker threads and such blocking is not appropriate for games. Test: SoundPoolAacTest SoundPoolHapticTest Test: SoundPoolMidiTest SoundPoolOggTest Bug: 175097719 Bug: 177287876 Change-Id: Iec777d6319d5ed76000d4c5b12336b106dacede4
- Loading branch information
Showing
2 changed files
with
22 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters