Closing an audio stream connection problem
Closing an audio stream connection problem
- Subject: Closing an audio stream connection problem
- From: "Oron Cherry" <email@hidden>
- Date: Thu, 17 May 2007 13:46:49 -0400
- Thread-topic: Closing an audio stream connection problem
Hello,
We are writing an application in C++ using port audio SDK v19 (which
uses the Mac core audio).
There are some issues closing our application.
Before we close we call PortAudio calls StopStream() and CloseStream()
that calls coreAudio functions specified below.
We have a crash on quit when closing the application with a single
device.
The crash is solved if we do a small sleep() between the stopStream()
and CloseStream() functions.
We suspect that the StopStream is called and returns without completion
(asynchronous way).
Then, the CloseStream is called when the stream is not stopped and
causes a crash.
Is there a way to get a confirmation that the thread responsible for
stopping the stream has finished before calling closeStream()?
static PaError StopStream( PaStream *s )
...
ERR_WRAP( AudioOutputUnitStop(stream->inputUnit) );
ERR_WRAP( AudioUnitReset(stream->inputUnit,
kAudioUnitScope_Global, 1) );
ERR_WRAP( AudioUnitReset(stream->inputUnit,
kAudioUnitScope_Global, 0) );
...
static PaError CloseStream( PaStream* s ) ...
AudioUnitUninitialize( stream->outputUnit );
CloseComponent( stream->outputUnit );
...
Thanks,
Oron
_______________________________________________
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