Core Audio output: Potential shutdown fix

The thread wait on shutdown had the potential to lock up waiting for the
thread to shut down. Now it should at least spam the semaphores, so that
the thread should progress to shutdown a lot quicker.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
This commit is contained in:
Christopher Snowhill 2022-01-26 23:40:18 -08:00
parent 3c35cf1037
commit cc2b27d43f

View file

@ -733,8 +733,11 @@ default_device_changed(AudioObjectID inObjectID, UInt32 inNumberAddresses, const
- (void)stop
{
if (stopNext && started && !paused) {
while (![[outputController buffer] isEmpty])
while (![[outputController buffer] isEmpty]) {
[writeSemaphore signal];
[readSemaphore signal];
usleep(500);
}
}
if (stopNext) {
stopNext = NO;