Compare commits

..

4 Commits

Author SHA1 Message Date
Thong Nguyen 97ca05662f Merge pull request #58 from mostafaberg/patch-1
Removed an iOS7 Deprecated function
2014-01-18 04:14:02 -08:00
Mostafa Torbjørn Berg 3780b2a2bd Removed an iOS7 Deprecated function
Minor code change to avoid using CFReadStreamCopyProperty and also fail if an error occurs
2014-01-14 14:30:32 +01:00
Thong Nguyen 7af1dd38aa Merge pull request #48 from johnboiles/master
Fixing playback for short clips (fixes #43)
2013-12-05 02:17:36 -08:00
John Boiles eeab471c42 Fixing playback for short clips 2013-12-03 16:12:43 -08:00
2 changed files with 20 additions and 4 deletions
@@ -2021,7 +2021,7 @@ static void AudioQueueIsRunningCallbackProc(void* userData, AudioQueueRef audioQ
currentlyReadingEntry.bufferIndex = audioPacketsReadCount;
currentlyReadingEntry = nil;
if (self.internalState == AudioPlayerInternalStatePlaying)
if (self.internalState | AudioPlayerInternalStateRunning)
{
if (audioQueue)
{
@@ -123,9 +123,25 @@
stream = CFReadStreamCreateWithFile(NULL, (__bridge CFURLRef)url);
SInt32 errorCode;
NSNumber* number = (__bridge_transfer NSNumber*)CFURLCreatePropertyFromResource(NULL, (__bridge CFURLRef)url, kCFURLFileLength, &errorCode);
NSError *fileError;
NSFileManager *manager = [[NSFileManager alloc] init];
NSString *path = [NSString stringWithUTF8String:[url fileSystemRepresentation]];
NSDictionary *attributes = [manager attributesOfItemAtPath:path
error:&fileError];
if (fileError)
{
CFReadStreamClose(stream);
CFRelease(stream);
stream = 0;
return;
}
NSNumber* number = [attributes objectForKey:@"NSFileSize"];
if (number)
{