From a9b1e143a0dd1aa9fdf028c3435f9166b26213ef Mon Sep 17 00:00:00 2001 From: Thong Nguyen Date: Fri, 31 Jan 2014 23:19:29 +0000 Subject: [PATCH] queueDataSource shold let playback thread automatically start the audio unit --- StreamingKit/StreamingKit/STKAudioPlayer.m | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/StreamingKit/StreamingKit/STKAudioPlayer.m b/StreamingKit/StreamingKit/STKAudioPlayer.m index 36f5736..defa6cc 100644 --- a/StreamingKit/StreamingKit/STKAudioPlayer.m +++ b/StreamingKit/StreamingKit/STKAudioPlayer.m @@ -497,11 +497,6 @@ static void AudioFileStreamPacketsProc(void* clientData, UInt32 numberBytes, UIn pthread_mutex_lock(&playerMutex); { [upcomingQueue enqueue:[[STKQueueEntry alloc] initWithDataSource:dataSourceIn andQueueItemId:queueItemId]]; - - if (self.internalState == STKAudioPlayerInternalStateStopped && stopReason == STKAudioPlayerStopReasonEof) - { - [self startAudioUnit]; - } } pthread_mutex_unlock(&playerMutex); @@ -1714,6 +1709,8 @@ static BOOL GetHardwareCodecClassDesc(UInt32 formatId, AudioClassDescription* cl { OSStatus status; + [self resetPcmBuffers]; + status = AudioOutputUnitStart(audioUnit); if (status)