# HG changeset patch # User diego # Date 1294435814 0 # Node ID 5533ffce9c6bfbdc251343172bca2165d8c47f94 # Parent 0cf4c6f3d56b6bec52e81b0094fef6339bea4317 Fix ao_coreaudio compilation on OS X 10.4. This version is the last OS version available for certain classes of PPC Macs, but it lacks AudioDeviceIOProcID, so it has to be emulated. patch by Aaro Koskinen, aaro.koskinen iki fi diff -r 0cf4c6f3d56b -r 5533ffce9c6b libao2/ao_coreaudio.c --- a/libao2/ao_coreaudio.c Thu Jan 06 21:05:34 2011 +0000 +++ b/libao2/ao_coreaudio.c Fri Jan 07 21:30:14 2011 +0000 @@ -68,6 +68,21 @@ /* Prefix for all mp_msg() calls */ #define ao_msg(a, b, c...) mp_msg(a, b, "AO: [coreaudio] " c) +#if MAC_OS_X_VERSION_MAX_ALLOWED <= 1040 +/* AudioDeviceIOProcID does not exist in Mac OS X 10.4. We can emulate + * this by using AudioDeviceAddIOProc() and AudioDeviceRemoveIOProc(). */ +#define AudioDeviceIOProcID AudioDeviceIOProc +#define AudioDeviceDestroyIOProcID AudioDeviceRemoveIOProc +static OSStatus AudioDeviceCreateIOProcID(AudioDeviceID dev, + AudioDeviceIOProc proc, + void *data, + AudioDeviceIOProcID *procid) +{ + *procid = proc; + return AudioDeviceAddIOProc(dev, proc, data); +} +#endif + typedef struct ao_coreaudio_s { AudioDeviceID i_selected_dev; /* Keeps DeviceID of the selected device. */