Closed zarcon closed 11 years ago
btw, if i define kNumAQBufs as 8, all ok with this track, but have some problems with others :(
Hi,
If you replace the start of the handlePropertyChangeForQueue:propertyID: method with the following code (leaving the @synchronized and everything below in place), this will avoid the deadlock:
// // handlePropertyChangeForQueue:propertyID: // // Implementation for ASAudioQueueIsRunningCallback // // Parameters: // inAQ - the audio queue // inID - the property ID //
(void)handlePropertyChangeForQueue:(AudioQueueRef)inAQ propertyID:(AudioQueuePropertyID)inID { NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
if (![[NSThread currentThread] isEqual:internalThread]) { [self performSelector:@selector(handlePropertyChange:) onThread:internalThread withObject:[NSNumber numberWithInt:inID] waitUntilDone:NO modes:[NSArray arrayWithObject:NSDefaultRunLoopMode]]; return; }
But this will not fix your problem with the kNumAQBufs value. The way that AudioStreamer works requires the audio buffers to be filled before playback starts. Your MP3 file is too small to fill the buffers so playback will fail. You would need to edit the code to play smaller numbers of buffers if the end-of-file is reached before the buffers are filled. You would need to work out how to do this yourself (I do not know where you would need to start).
Regards, Matt Gallagher.
On 21/02/2013, at 6:17 PM, zarcon notifications@github.com wrote:
btw, if i define kNumAQBufs as 8, all ok with this track, but have some problems with other :(
— Reply to this email directly or view it on GitHub.
Thanks for the enlightenment, Matt, I will try
Hello. Sorry for my English.
I try to write Stream Playe. And i use your library, thanks for that very much.
All be okey for some time. But tomorrow i play one track - (you can try - http://z-media.su/fbc94025c81b.mp3 )
buffering for few seconds and deadlock! When i pause simulator, debugger show on @synchronized block in "progress" method.
This problem not only in my app, but and with your example app :(