changeset 32683:5533ffce9c6b

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
author diego
date Fri, 07 Jan 2011 21:30:14 +0000
parents 0cf4c6f3d56b
children 58cd752c58d8
files libao2/ao_coreaudio.c
diffstat 1 files changed, 15 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- 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. */