From: Andre Noll Date: Thu, 9 Aug 2012 19:07:03 +0000 (+0200) Subject: osx_write: Check return value of AudioOutputUnitStart(). X-Git-Tag: v0.4.12~8^2 X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=commitdiff_plain;h=9eaa22ecdafa718fc2a84a70d442c829ae7e1b34 osx_write: Check return value of AudioOutputUnitStart(). This function may fail, and we even have an error code for this condition available. --- diff --git a/osx_write.c b/osx_write.c index d278d02c..2894f11e 100644 --- a/osx_write.c +++ b/osx_write.c @@ -318,7 +318,13 @@ static void osx_write_post_select(__a_unused struct sched *s, struct task *t) if (ret < 0) goto remove_btrn; powd = wn->private_data; - AudioOutputUnitStart(powd->audio_unit); + ret = -E_UNIT_START; + if (AudioOutputUnitStart(powd->audio_unit) != noErr) { + AudioUnitUninitialize(powd->audio_unit); + CloseComponent(powd->audio_unit); + btr_remove_node(&powd->callback_btrn); + goto remove_btrn; + } } mutex_lock(powd->mutex); ret = btr_node_status(btrn, wn->min_iqs, BTR_NT_INTERNAL);