Re: atexit and kAudioDevicePropertyDeviceIsRunning problem
Re: atexit and kAudioDevicePropertyDeviceIsRunning problem
- Subject: Re: atexit and kAudioDevicePropertyDeviceIsRunning problem
- From: Jeff Moore <email@hidden>
- Date: Fri, 28 Apr 2006 12:02:04 -0700
On Apr 28, 2006, at 11:54 AM, Michael Guntsche wrote:
On Apr 28, 2006, at 20:33, Jeff Moore wrote:
If one is using atexit(), one has to be cognizant that a lot of
services are going to be in an indeterminate state.
Well what I mean is that libao itself is NOT using atexit on close
but another application might use libaos close function in an atexit
() and I have to take that into account. Right now I have two
applications running here using libao (uade and adplay). While uade
just calls the close function at the end, adplay calls it in an
atexit(). So uade just stops while adplay hangs on shutdown.
I see. I was misunderstanding.
If there is no other way I'll just shutdown everything without
waiting for the buffers to be emptied. Since HAL is also stopping
the ioprocs is it a problem if this is done twice? First by me
and then by the HAL or the other way around.
As long as you are prepared for possibly getting errors from the
HAL since the HAL may have already unloaded itself by the time you
get to run.
My idea is to just teardown the audio unit ignoring any errors. It
is not the most cleanest way but the worst case that can happen is
that I try to close an audiounit that IS already closed.
Why even do that much work? There's no reason to. The kernel will
take care of cleaning up any open AUs as a matter of course as part
of tearing the process down.
--
Jeff Moore
Core Audio
Apple
_______________________________________________
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