Fixed AudioPlayer taking a few seconds longer than necessary to start playing for first file

This commit is contained in:
Thong Nguyen 2013-01-20 13:25:14 +00:00
parent 836885b946
commit d2d9ccbf2b
1 changed files with 4 additions and 5 deletions

View File

@ -1536,17 +1536,16 @@ static void AudioQueueIsRunningCallbackProc(void* userData, AudioQueueRef audioQ
packetsFilled = 0;
[playbackThreadRunLoop addPort:[NSPort port] forMode:NSDefaultRunLoopMode];
do
while (true)
{
[playbackThreadRunLoop runMode:NSDefaultRunLoopMode beforeDate:[NSDate dateWithTimeIntervalSinceNow:5]];
if (![self processRunloop])
{
break;
}
[playbackThreadRunLoop runMode:NSDefaultRunLoopMode beforeDate:[NSDate dateWithTimeIntervalSinceNow:10]];
}
while (true);
disposeWasRequested = NO;
seekToTimeWasRequested = NO;