我使用Matt Gallagher的AudioSteamer实现了在线音乐播放功能,我发现有时在线音乐正在播放,但audiostreamer的状态不会变成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]];
}不执行..。我真的不知道如何修复它...anybody帮助我?谢谢..
发布于 2013-10-22 22:58:51
我也有这个问题。我添加了以下代码:
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]];https://stackoverflow.com/questions/18610705
复制相似问题