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

Commit 5a6cd224 authored by Glenn Kasten's avatar Glenn Kasten
Browse files

Fix slow AudioTrack and AudioRecord destruction

There were two causes for the slowness:

When thread was paused, it used nanosleep and sleep.  These usually
run to completion (except for POSIX signal, which we avoid because it
is low-level).  Instead, replace the nanosleep and sleep by condition
timed wait, as that can be made to return early by a condition signal.
Another advantage of condition timed wait is that a condition wait was
already being used at top of thread loop, so it is a simpler change.

The AudioRecord destructor was missing a proxy interrupt that was correct
in AudioTrack.  This proxy interrupt is needed in case another thread
is blocked in proxy obtainBuffer.

Does not address the 1 second polling for NS_WHENEVER.

Bug: 10822765
Change-Id: Id665994551e87e4d7da9c7b015f424fd7a0b5560
parent a3b97ad2
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment