Handling NSRunLoop with AUGraph
Handling NSRunLoop with AUGraph
- Subject: Handling NSRunLoop with AUGraph
- From: Sasikumar JP <email@hidden>
- Date: Fri, 03 Jun 2011 10:35:16 +0530
Hi,
I am working on streaming audio application.
Sorry for cross posting, I am facing the issue with NSRunLoop and AUGraph.
What is the correct approach to handle the runloop with AUGraph. I have gone through the apple documentation and implemented the following.
1. Created a secondary thread using NSThread
2. In the thread method created a http socket stream and scheduled it with run loop
3 initialise the audio session and audio graph.
4. Opened the stream
5. Created the following loop
do {
Run the loop in default run loop mode
} while (isRunning && ![self shouldStop];
When I want to stop playing the audio. I am calling AUGraphStop() then setting the flag shouldStop =YES to terminate the secondary thread.This case secondary thread hung, as it is not returning from runloop call.
If I dont call theAUGraphStop() when I stop the audio, thread is terminating as expected. But I am hearing noise as audio graph is stopped properly.
Is there anything wrong in the way I am handling the runloop with AUGraph which makes the runloop to wait for ever.
Any help is highly appreciated.
Thanks
Sasikumar JP
Sent from my iPad
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden