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>
CQTexperiment
Christopher Snowhill 2022-01-26 23:40:18 -08:00
parent 3c35cf1037
commit cc2b27d43f
1 changed files with 4 additions and 1 deletions

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;