Skip to content

Commit

Permalink
Patched to compile without capture support.
Browse files Browse the repository at this point in the history
  • Loading branch information
icculus committed Mar 17, 2005
1 parent 6a6ad08 commit f6c6272
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions osx/alContext.c
Expand Up @@ -1269,7 +1269,7 @@ static ALCdevice* __alcOpenDeviceInternal(const ALubyte *deviceName,
{
Boolean isInput = isOutput ? FALSE : TRUE;
AudioDeviceID device;
AudioDeviceIOProc ioproc;
AudioDeviceIOProc ioproc = __alcMixDevice;
Boolean writable;
OSStatus error;
UInt32 count;
Expand All @@ -1278,6 +1278,11 @@ static ALCdevice* __alcOpenDeviceInternal(const ALubyte *deviceName,
ALdevice *retval = NULL;
AudioStreamBasicDescription *streamFormats;

#if SUPPORTS_ALC_EXT_CAPTURE
if (isInput)
ioproc = __alcCaptureDevice;
#endif

if (!__alcDoFirstInit())
return(NULL);

Expand Down Expand Up @@ -1354,7 +1359,6 @@ static ALCdevice* __alcOpenDeviceInternal(const ALubyte *deviceName,
// Set up default speaker attributes.
__alcSetSpeakerDefaults(retval);

ioproc = ((isOutput) ? __alcMixDevice : __alcCaptureDevice);
if (AudioDeviceAddIOProc(device, ioproc, retval) != kAudioHardwareNoError)
{
AudioDeviceRemoveIOProc(device, ioproc);
Expand Down Expand Up @@ -1385,14 +1389,18 @@ ALCAPI ALCdevice* ALCAPIENTRY alcOpenDevice(const ALubyte *deviceName)
ALCAPI ALvoid ALCAPIENTRY alcCloseDevice( ALCdevice *device )
{
ALdevice *dev = (ALdevice *) device;
AudioDeviceIOProc ioproc;

// Contexts associated with this device still exist?
if (dev->createdContexts[0] != NULL)
__alcSetError(dev, ALC_INVALID);
else
{
ioproc = ((dev->isInputDevice) ? __alcCaptureDevice : __alcMixDevice);
AudioDeviceIOProc ioproc = __alcMixDevice;
#if SUPPORTS_ALC_EXT_CAPTURE
if (dev->isInputDevice)
ioproc = __alcCaptureDevice;
#endif

AudioDeviceStop(dev->device, ioproc);
AudioDeviceRemoveIOProc(dev->device, ioproc);

Expand Down

0 comments on commit f6c6272

Please sign in to comment.