Cog Audio: Fix potential hang on stop

The ChunkList wasn't clearing the remover entered flag when the chain
was empty. Now it does, so it will shut down correctly.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
This commit is contained in:
Christopher Snowhill 2022-02-07 15:31:57 -08:00
parent 418d03ae23
commit 91da112e35

View file

@ -74,8 +74,10 @@
@synchronized(chunkList) {
inRemover = YES;
if(![chunkList count])
if(![chunkList count]) {
inRemover = NO;
return [[AudioChunk alloc] init];
}
AudioChunk *chunk = [chunkList objectAtIndex:0];
if([chunk frameCount] <= maxFrameCount) {
[chunkList removeObjectAtIndex:0];