AudioStreamer
AudioStreamer copied to clipboard
stop method causes EXC_BAD_ACCESS on some rare cases
When I play a short part (less than a second) of a lot of songs in a row and always stop the currently playing song with the stop method, sometimes the method will crash the program.
The crash happens in this call (inside the while loop):
[NSThread sleepForTimeInterval:0.1];
I haven't managed to reproduce this systematically but I get the same crash about every other time I ran the program. On some cases the debugger will be caught in a loop and app will not crash but hangs up. Activating a breakpoint on that particular line doesn't produce a break.
Anyone else having the same problem?
More info: Seems to happen only on the simulator. Haven't been able to reproduce it on the device.
I debugged a bit more and got this message in the console:
"AudioQueue changed state in unexpected way."
After about 5 clicks after that (i.e. starting 5 new songs) the app crashed.
After more debugging, it turns out that the handlePropertyChangeForQueue gets called when the object is in state AS_AUDIO_QUEUE_CREATION_FAILED:
"AudioQueue changed state in unexpected way. state = 8"
After a couple of plays after that, app crashes and before crash I saw this in the console:
"
hello, please did you manage to resolve this issue , im facing the same problem. Thnaks