Commit 451f60f7 authored by Pierre-Eric Pelloux-Prayer's avatar Pierre-Eric Pelloux-Prayer
Browse files

iounit: do not unconfigure iounit if configure has failed

parent c91947b5
......@@ -519,13 +519,16 @@ static void au_configure_write(AUData *d, uint64_t t) {
static void au_unconfigure(AUData *d) {
if (d->write_started==FALSE && d->read_started==FALSE) {
AudioUnitUninitialize(d->io_unit);
AudioOutputUnitStop(d->io_unit);
AudioComponentInstanceDispose (d->io_unit);
d->started=FALSE;
check_auresult(AudioSessionSetActive(false),"AudioSessionSetActive(false)");
}
/* unconfigure only if io_unit was successfully started */
if (d->started) {
if (d->write_started==FALSE && d->read_started==FALSE) {
AudioUnitUninitialize(d->io_unit);
AudioOutputUnitStop(d->io_unit);
AudioComponentInstanceDispose (d->io_unit);
d->started=FALSE;
check_auresult(AudioSessionSetActive(false),"AudioSessionSetActive(false)");
}
}
}
static void au_unconfigure_read(AUData *d){
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment