From b75a826b9ac578f40e5651bc15da723a358ca854 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Sun, 22 Feb 2015 23:44:23 +0100 Subject: [PATCH] fix return value on AU error in e070701 --- libs/appleutility/CAAudioUnit.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/libs/appleutility/CAAudioUnit.cpp b/libs/appleutility/CAAudioUnit.cpp index 76798d4e0f..53ef649afd 100644 --- a/libs/appleutility/CAAudioUnit.cpp +++ b/libs/appleutility/CAAudioUnit.cpp @@ -357,8 +357,8 @@ int CAAudioUnit::GetChannelInfo (AUChannelInfo** chaninfo, UInt32& cnt) UInt32 elCountIn, elCountOut, elCount; - if (GetElementCount (kAudioUnitScope_Input, elCountIn)) return 1; - if (GetElementCount (kAudioUnitScope_Output, elCountOut)) return 1; + if (GetElementCount (kAudioUnitScope_Input, elCountIn)) return -1; + if (GetElementCount (kAudioUnitScope_Output, elCountOut)) return -1; elCount = std::max(elCountIn, elCountOut); @@ -366,17 +366,16 @@ int CAAudioUnit::GetChannelInfo (AUChannelInfo** chaninfo, UInt32& cnt) for (unsigned int i = 0; i < elCountIn; ++i) { UInt32 numChans; - if (NumberChannels (kAudioUnitScope_Input, i, numChans)) return 1; + if (NumberChannels (kAudioUnitScope_Input, i, numChans)) return -1; (*chaninfo)[i].inChannels = numChans; } for (unsigned int i = elCountIn; i < elCount; ++i) { (*chaninfo)[i].inChannels = 0; } - for (unsigned int i = 0; i < elCountOut; ++i) { UInt32 numChans; - if (NumberChannels (kAudioUnitScope_Output, i, numChans)) return 1; + if (NumberChannels (kAudioUnitScope_Output, i, numChans)) return -1; (*chaninfo)[i].outChannels = numChans; } for (unsigned int i = elCountOut; i < elCount; ++i) {