mattgallagher / AudioStreamer

A streaming audio player class (AudioStreamer) for Mac OS X and iPhone.
http://cocoawithlove.com
1.93k stars 553 forks source link

Sometimes the state didn't change to AS_PLAYING while the online music is playing~ #74

Open vieriwml opened 11 years ago

vieriwml commented 11 years ago

I found that ,when I play the music with audiostreamer , sometimes the state didn't change to AS_PLAYING while the online music is playing. I debug the codes , I found that ,sometimes after the codes if (![[NSThread currentThread] isEqual:internalThread]) { [self performSelector:@selector(handlePropertyChange:) onThread:internalThread withObject:[NSNumber numberWithInt:inID] waitUntilDone:NO modes:[NSArray arrayWithObject:NSDefaultRunLoopMode]]; return; } in the functions - (void)handlePropertyChangeForQueue:(AudioQueueRef)inAQ propertyID:(AudioQueuePropertyID)inID execute , the function - (void)handlePropertyChange:(NSNumber *)num { [self handlePropertyChangeForQueue:NULL propertyID:[num intValue]]; } didn't execute...so the state keep the AS_WAITING_FOR_QUEUE_TO_START and wouldn't change to AS_PLAYING, anybody help me ?? what's the reason? How can I fix it.... thanks~

paulshapiro commented 10 years ago

Bump. I am experiencing this as well.

catbus commented 10 years ago

Exact same issue here, currently looking for a solution. Happens intermittently.

hiren443 commented 10 years ago

Same issue here. Please give me solution.

atomictag commented 10 years ago

Same problem here. I tried commenting out the code that checks the current thread:

if (![[NSThread currentThread] isEqual:internalThread]) { ... }

and it seems to solve the problem. Not sure this is the right solution, but give it a spin.

Yaqoot commented 10 years ago

same here I have been try to fix it for long .. @atomictag what did you do exactly , plz share us

mike-ferenduros commented 9 years ago

Same here.

Looks 'enqueueBuffer' is blocking the internal thread, preventing 'handlePropertyChangeForQueue' from happening. I did the same as atomic and commented out lines 1877-1886 as a quick fix but yeah, it's not the right solution.

NemoAir commented 8 years ago

Is Anyone solved this? commet if (![[NSThread currentThread] isEqual:internalThread]) { ... } is not the right solution? @mattgallagher