If you have an issue with any of our projects. feel free to register.

Commit b7487e2a authored by Christopher Snowhill's avatar Christopher Snowhill

Clean up audio output code just a bit

parent b7596caa
......@@ -6,6 +6,7 @@
// Copyright 2005 Vincent Spader. All rights reserved.
//
#import <AssertMacros.h>
#import <Cocoa/Cocoa.h>
#import <CoreAudio/AudioHardware.h>
......
//
//
// OutputCoreAudio.m
// Cog
//
......@@ -225,7 +225,7 @@ static OSStatus Sound_Renderer(void *inRefCon, AudioUnitRenderActionFlags *ioAc
};
UInt32 dataSize;
ComponentDescription desc;
AudioComponentDescription desc;
OSStatus err;
desc.componentType = kAudioUnitType_Output;
......@@ -234,11 +234,11 @@ static OSStatus Sound_Renderer(void *inRefCon, AudioUnitRenderActionFlags *ioAc
desc.componentFlags = 0;
desc.componentFlagsMask = 0;
Component comp = FindNextComponent(NULL, &desc); //Finds an component that meets the desc spec's
AudioComponent comp = AudioComponentFindNext(NULL, &desc); //Finds an component that meets the desc spec's
if (comp == NULL)
return NO;
err = OpenAComponent(comp, &outputUnit); //gains access to the services provided by the component
err = AudioComponentInstanceNew(comp, &outputUnit); //gains access to the services provided by the component
if (err)
return NO;
......@@ -344,7 +344,7 @@ static OSStatus Sound_Renderer(void *inRefCon, AudioUnitRenderActionFlags *ioAc
deviceChannelMap[i] = i;
}
free(preferredChannelLayout), preferredChannelLayout = nil;
free(preferredChannelLayout); preferredChannelLayout = nil;
}
else {
// Just use a channel map that makes sense
......@@ -415,7 +415,7 @@ static OSStatus Sound_Renderer(void *inRefCon, AudioUnitRenderActionFlags *ioAc
{
AudioOutputUnitStop(outputUnit);
AudioUnitUninitialize (outputUnit);
CloseComponent(outputUnit);
AudioComponentInstanceDispose(outputUnit);
outputUnit = NULL;
}
}
......
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