[MPlayer-cvslog] r32770 - trunk/libao2/ao_coreaudio.c

diego subversion at mplayerhq.hu
Fri Jan 7 22:30:14 CET 2011


Author: diego
Date: Fri Jan  7 22:30:14 2011
New Revision: 32770

Log:
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

Modified:
   trunk/libao2/ao_coreaudio.c

Modified: trunk/libao2/ao_coreaudio.c
==============================================================================
--- trunk/libao2/ao_coreaudio.c	Thu Jan  6 22:05:34 2011	(r32769)
+++ trunk/libao2/ao_coreaudio.c	Fri Jan  7 22:30:14 2011	(r32770)
@@ -68,6 +68,21 @@ LIBAO_EXTERN(coreaudio)
 /* 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. */


More information about the MPlayer-cvslog mailing list