From 7c33c34b0cb7e6049f8aa66fadef2bd0ca93baf2 Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Sun, 23 Oct 2016 20:33:59 -0400 Subject: [PATCH] Have withdrawn attempt to be clever with client notification here, as it was having no effect in the current environment, making it hard to build up any confidence. --- OSBindings/Mac/Clock Signal/Audio/CSAudioQueue.m | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/OSBindings/Mac/Clock Signal/Audio/CSAudioQueue.m b/OSBindings/Mac/Clock Signal/Audio/CSAudioQueue.m index a99fdf3b5..1153e0686 100644 --- a/OSBindings/Mac/Clock Signal/Audio/CSAudioQueue.m +++ b/OSBindings/Mac/Clock Signal/Audio/CSAudioQueue.m @@ -14,22 +14,13 @@ @implementation CSAudioQueue { AudioQueueRef _audioQueue; - size_t _queuedSamples; - BOOL _hasHad256; } #pragma mark - AudioQueue callbacks - (void)audioQueue:(AudioQueueRef)theAudioQueue didCallbackWithBuffer:(AudioQueueBufferRef)buffer { - size_t samplesInBuffer = (size_t)(buffer->mAudioDataByteSize / sizeof(int16_t)); - if(_queuedSamples >= 128 && _queuedSamples - samplesInBuffer < 128 && _hasHad256) - { - _hasHad256 = NO; - [self.delegate audioQueueIsRunningDry:self]; - } - _queuedSamples -= samplesInBuffer; - + [self.delegate audioQueueIsRunningDry:self]; AudioQueueFreeBuffer(_audioQueue, buffer); } @@ -106,8 +97,6 @@ static void audioOutputCallback( { AudioQueueBufferRef newBuffer; size_t bufferBytes = lengthInSamples * sizeof(int16_t); - _queuedSamples += lengthInSamples; - _hasHad256 |= (_queuedSamples >= 256); AudioQueueAllocateBuffer(_audioQueue, (UInt32)bufferBytes, &newBuffer); memcpy(newBuffer->mAudioData, buffer, bufferBytes);