我使用Matt Gallagher的AudioSteamer来实现在线音乐播放功能,我发现有时在线音乐正在播放,但音频流媒体的状态没有变为AS_playing,有人遇到同样的问题吗?你能告诉我如何解决这个问题吗~~谢谢~
我想其中一个原因是:
if (![[NSThread currentThread] isEqual:internalThread])
{
[self
performSelector:@selector(handlePropertyChange:)
onThread:internalThread
withObject:[NSNumber numberWithInt:inID]
waitUntilDone:NO
modes:[NSArray arrayWithObject:NSDefaultRunLoopMode]];
return;
}
在中执行这些代码之后
- (void)handlePropertyChangeForQueue:(AudioQueueRef)inAQ
propertyID:(AudioQueuePropertyID)inID
功能:
- (void)handlePropertyChange:(NSNumber *)num
{
[self handlePropertyChangeForQueue:NULL propertyID:[num intValue]];
}
不执行。。。我真的不知道该怎么修。。。有人帮我吗?谢谢
我也有这个问题。我添加了这个代码:
if (state == AS_WAITING_FOR_QUEUE_TO_START){
@synchronized(self){
self.state = AS_PLAYING;
}
}
进入方法:
- (void)handlePropertyChangeForQueue:(AudioQueueRef)inAQ
propertyID:(AudioQueuePropertyID)inID
就在这次通话之前:
[self
performSelector:@selector(handlePropertyChange:)
onThread:internalThread
withObject:[NSNumber numberWithInt:inID]
waitUntilDone:NO
modes:[NSArray arrayWithObject:NSDefaultRunLoopMode]];