Audio Output: Made converter cleanup atomic, to wait on any threads that are still running

CQTexperiment
Christopher Snowhill 2021-12-26 04:34:33 -08:00
parent 106eb587b4
commit 1cc34ea7d4
1 changed files with 5 additions and 5 deletions

View File

@ -557,11 +557,6 @@ static float db_to_scale(float db)
- (void)inputFormatDidChange:(AudioStreamBasicDescription)format
{
DLog(@"FORMAT CHANGED");
stopping = YES;
while (convertEntered || ACInputEntered || ACFloatEntered)
{
usleep(500);
}
[self cleanUp];
[self setupWithInputFormat:format outputFormat:outputFormat];
}
@ -575,6 +570,11 @@ static float db_to_scale(float db)
- (void)cleanUp
{
stopping = YES;
while (convertEntered || ACInputEntered || ACFloatEntered)
{
usleep(500);
}
rgInfo = nil;
if (converterFloat)
{