[MPlayer-dev-eng] [PATCH RESEND] Mac OS X: fix libao2 compilation on Mac OS X 10.4
Aaro Koskinen
aaro.koskinen at iki.fi
Thu Jan 6 20:45:17 CET 2011
On Wed, 5 Jan 2011, Diego Biurrun wrote:
> On Wed, Jan 05, 2011 at 08:56:47PM +0100, Beno?t Amiaux wrote:
>> On 05/01/11 11:49, Diego Biurrun wrote:
>>> On Sun, Dec 19, 2010 at 04:38:52PM +0200, Aaro Koskinen wrote:
>>>> On Wed, 15 Dec 2010, Diego Biurrun wrote:
>>>>> On Fri, Dec 10, 2010 at 11:48:55PM +0200, Aaro Koskinen wrote:
>>>>>> +#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
>>>>>> {
>>>>>
>>>>> Please place your function below the struct declaration.
>>>>
>>>> I can move it if that's needed, I just wanted to avoid creating multiple
>>>> #if ... #endif sections.
>>>
>>> I don't see why moving the function a few lines down would entail adding
>>> more #ifdefs.
>>
>> Diego, you need to have this #ifdef hunk *before* the struct because it
>> redefines AudioDeviceIOProcID which is used in the struct.
>>
>> I like this patch because it's easy to remove/ignore. Please apply for
>> those poor souls who use OS X 10.4.
>
> I would gladly commit it if I were given a patch that applies cleanly.
Hmm, perhaps I'm not creating the patch correctly then, because when
I do the changes on top of the latest revision, the resulting patch is
still identical to the one I already sent. It's here both inlined and
attached. I'm creating the patch using "svn diff" and I can apply it with
"patch -p0 < ..." to a clean tree (revision 32768).
(I also checked the archived copy from
http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20101128/b27cec90/attachment.obj
to ensure that it doesn't get corrupted when e-mailed.)
A.
Index: libao2/ao_coreaudio.c
===================================================================
--- libao2/ao_coreaudio.c (revision 32768)
+++ libao2/ao_coreaudio.c (working copy)
@@ -68,6 +68,23 @@
/* 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. */
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mplayer-libao2-coreaudio-tiger.patch
Type: text/x-diff
Size: 989 bytes
Desc: patch
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20110106/63c2f2a6/attachment.patch>
More information about the MPlayer-dev-eng
mailing list