[PATCH RESEND] Mac OS X: fix libao2 compilation on Mac OS X 10.4
Hello, The patch below fixes mplayer compilation on Mac OS X 10.4 (it has been broken since r31713). Please apply - it should not change anything on newer Mac OS X versions. A. Index: libao2/ao_coreaudio.c =================================================================== --- libao2/ao_coreaudio.c (revision 32667) +++ 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. */
Aaro Koskinen <aaro.koskinen <at> iki.fi> writes:
The patch below fixes mplayer compilation on Mac OS X 10.4 (it has been broken since r31713). Please apply - it should not change anything on newer Mac OS X versions.
I will apply this patch if nobody objects. Carl Eugen
On Fri, Dec 10, 2010 at 11:48:55PM +0200, Aaro Koskinen wrote:
The patch below fixes mplayer compilation on Mac OS X 10.4 (it has been broken since r31713). Please apply - it should not change anything on newer Mac OS X versions.
Apparently you do actually use 10.4, but - I'm curious - why? I have yet to meet a Mac user that hasn't updated to 10.5 at least...
--- libao2/ao_coreaudio.c (revision 32667) +++ 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().
Wouldn't it be more portable to implement it this way for all OS X versions?
+ */ +#define AudioDeviceIOProcID AudioDeviceIOProc +#define AudioDeviceDestroyIOProcID AudioDeviceRemoveIOProc +static OSStatus AudioDeviceCreateIOProcID(AudioDeviceID dev, + AudioDeviceIOProc proc, + void *data, + AudioDeviceIOProcID *procid) +{ + *procid = proc; + return AudioDeviceAddIOProc(dev, proc, data);
Why the procid variable indirection?
+} +#endif + typedef struct ao_coreaudio_s {
Please place your function below the struct declaration. Diego
I seem to recall this file was specifically updated for 10.5+ as the old structures were being deprecated. -- Sean -----Original Message----- From: Diego Biurrun <diego@biurrun.de> Sender: mplayer-dev-eng-bounces@mplayerhq.hu Date: Wed, 15 Dec 2010 14:19:31 To: <mplayer-dev-eng@mplayerhq.hu> Reply-To: mplayer-dev-eng@mplayerhq.hu Subject: Re: [MPlayer-dev-eng] [PATCH RESEND] Mac OS X: fix libao2 compilation on Mac OS X 10.4 On Fri, Dec 10, 2010 at 11:48:55PM +0200, Aaro Koskinen wrote:
The patch below fixes mplayer compilation on Mac OS X 10.4 (it has been broken since r31713). Please apply - it should not change anything on newer Mac OS X versions.
Apparently you do actually use 10.4, but - I'm curious - why? I have yet to meet a Mac user that hasn't updated to 10.5 at least...
--- libao2/ao_coreaudio.c (revision 32667) +++ 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().
Wouldn't it be more portable to implement it this way for all OS X versions?
+ */ +#define AudioDeviceIOProcID AudioDeviceIOProc +#define AudioDeviceDestroyIOProcID AudioDeviceRemoveIOProc +static OSStatus AudioDeviceCreateIOProcID(AudioDeviceID dev, + AudioDeviceIOProc proc, + void *data, + AudioDeviceIOProcID *procid) +{ + *procid = proc; + return AudioDeviceAddIOProc(dev, proc, data);
Why the procid variable indirection?
+} +#endif + typedef struct ao_coreaudio_s {
Please place your function below the struct declaration. Diego _______________________________________________ MPlayer-dev-eng mailing list MPlayer-dev-eng@mplayerhq.hu https://lists.mplayerhq.hu/mailman/listinfo/mplayer-dev-eng
*PLEASE* don't top-post. On Wed, Dec 15, 2010 at 01:51:23PM +0000, Sean McGovern wrote:
I seem to recall this file was specifically updated for 10.5+ as the old structures were being deprecated.
I don't quite get what your point is...
-----Original Message----- From: Diego Biurrun <diego@biurrun.de> Sender: mplayer-dev-eng-bounces@mplayerhq.hu Date: Wed, 15 Dec 2010 14:19:31 To: <mplayer-dev-eng@mplayerhq.hu> Reply-To: mplayer-dev-eng@mplayerhq.hu Subject: Re: [MPlayer-dev-eng] [PATCH RESEND] Mac OS X: fix libao2 compilation on Mac OS X 10.4
On Fri, Dec 10, 2010 at 11:48:55PM +0200, Aaro Koskinen wrote:
The patch below fixes mplayer compilation on Mac OS X 10.4 (it has been broken since r31713). Please apply - it should not change anything on newer Mac OS X versions.
Apparently you do actually use 10.4, but - I'm curious - why? I have yet to meet a Mac user that hasn't updated to 10.5 at least...
We've been through this before -- on my BlackBerry I don't have a choice, I can't edit below or inline with the mail I'm replying to. As to the changes, I'm not in front of my Mac at the moment but browsing the git mirror, was it Adrian's changes in July that messed up 10.4? -- Sean -----Original Message----- From: Diego Biurrun <diego@biurrun.de> Sender: mplayer-dev-eng-bounces@mplayerhq.hu Date: Wed, 15 Dec 2010 15:00:25 To: <mplayer-dev-eng@mplayerhq.hu> Reply-To: mplayer-dev-eng@mplayerhq.hu Subject: Re: [MPlayer-dev-eng] [PATCH RESEND] Mac OS X: fixlibao2 compilation on Mac OS X 10.4 *PLEASE* don't top-post. On Wed, Dec 15, 2010 at 01:51:23PM +0000, Sean McGovern wrote:
I seem to recall this file was specifically updated for 10.5+ as the old structures were being deprecated.
I don't quite get what your point is...
-----Original Message----- From: Diego Biurrun <diego@biurrun.de> Sender: mplayer-dev-eng-bounces@mplayerhq.hu Date: Wed, 15 Dec 2010 14:19:31 To: <mplayer-dev-eng@mplayerhq.hu> Reply-To: mplayer-dev-eng@mplayerhq.hu Subject: Re: [MPlayer-dev-eng] [PATCH RESEND] Mac OS X: fix libao2 compilation on Mac OS X 10.4
On Fri, Dec 10, 2010 at 11:48:55PM +0200, Aaro Koskinen wrote:
The patch below fixes mplayer compilation on Mac OS X 10.4 (it has been broken since r31713). Please apply - it should not change anything on newer Mac OS X versions.
Apparently you do actually use 10.4, but - I'm curious - why? I have yet to meet a Mac user that hasn't updated to 10.5 at least...
MPlayer-dev-eng mailing list MPlayer-dev-eng@mplayerhq.hu https://lists.mplayerhq.hu/mailman/listinfo/mplayer-dev-eng
On Wed, Dec 15, 2010 at 02:44:04PM +0000, Sean McGovern wrote:
We've been through this before -- on my BlackBerry I don't have a choice, I can't edit below or inline with the mail I'm replying to.
Correct, we've been through this before. Clearly nobody is forcing you to reply from a BlackBerry, not back then, not now.
-----Original Message----- From: Diego Biurrun <diego@biurrun.de> Sender: mplayer-dev-eng-bounces@mplayerhq.hu Date: Wed, 15 Dec 2010 15:00:25 To: <mplayer-dev-eng@mplayerhq.hu> Reply-To: mplayer-dev-eng@mplayerhq.hu Subject: Re: [MPlayer-dev-eng] [PATCH RESEND] Mac OS X: fixlibao2 compilation on Mac OS X 10.4
*PLEASE* don't top-post.
On Wed, Dec 15, 2010 at 01:51:23PM +0000, Sean McGovern wrote:
I seem to recall this file was specifically updated for 10.5+ as the old structures were being deprecated.
I don't quite get what your point is...
-----Original Message----- From: Diego Biurrun <diego@biurrun.de> Sender: mplayer-dev-eng-bounces@mplayerhq.hu Date: Wed, 15 Dec 2010 14:19:31 To: <mplayer-dev-eng@mplayerhq.hu> Reply-To: mplayer-dev-eng@mplayerhq.hu Subject: Re: [MPlayer-dev-eng] [PATCH RESEND] Mac OS X: fix libao2 compilation on Mac OS X 10.4
On Fri, Dec 10, 2010 at 11:48:55PM +0200, Aaro Koskinen wrote:
The patch below fixes mplayer compilation on Mac OS X 10.4 (it has been broken since r31713). Please apply - it should not change anything on newer Mac OS X versions.
Apparently you do actually use 10.4, but - I'm curious - why? I have yet to meet a Mac user that hasn't updated to 10.5 at least...
Hello, On Wed, 15 Dec 2010, Diego Biurrun wrote:
On Fri, Dec 10, 2010 at 11:48:55PM +0200, Aaro Koskinen wrote:
The patch below fixes mplayer compilation on Mac OS X 10.4 (it has been broken since r31713). Please apply - it should not change anything on newer Mac OS X versions.
Apparently you do actually use 10.4, but - I'm curious - why?
Mainly because I have some old Macs which are not supported by newer Mac OS X versions.
--- libao2/ao_coreaudio.c (revision 32667) +++ 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().
Wouldn't it be more portable to implement it this way for all OS X versions?
Based on commit r31713 the old functions are deprecated on newer versions (however not yet on 10.4), which probably means you'll get compilation warnings and probably at some point they will be removed.
+ */ +#define AudioDeviceIOProcID AudioDeviceIOProc +#define AudioDeviceDestroyIOProcID AudioDeviceRemoveIOProc +static OSStatus AudioDeviceCreateIOProcID(AudioDeviceID dev, + AudioDeviceIOProc proc, + void *data, + AudioDeviceIOProcID *procid) +{ + *procid = proc; + return AudioDeviceAddIOProc(dev, proc, data);
Why the procid variable indirection?
The procid is an output parameter returning a handle to the caller which is used for removal.
+} +#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. A.
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:
The patch below fixes mplayer compilation on Mac OS X 10.4 (it has been broken since r31713). Please apply - it should not change anything on newer Mac OS X versions.
Apparently you do actually use 10.4, but - I'm curious - why?
Mainly because I have some old Macs which are not supported by newer Mac OS X versions.
I'm curious again: Which ones would that be? 10.5 worked fine on my (recently deceased) PPC Mac... Diego
On 22 dec 2010, at 12:50, Diego Biurrun <diego@biurrun.de> 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:
The patch below fixes mplayer compilation on Mac OS X 10.4 (it has been broken since r31713). Please apply - it should not change anything on newer Mac OS X versions.
Apparently you do actually use 10.4, but - I'm curious - why?
Mainly because I have some old Macs which are not supported by newer Mac OS X versions.
I'm curious again: Which ones would that be? 10.5 worked fine on my (recently deceased) PPC Mac...
The oldest (800 MHz?) do not allow installing 10.5 without hacks.
Hi, On Wed, 22 Dec 2010, 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:
The patch below fixes mplayer compilation on Mac OS X 10.4 (it has been broken since r31713). Please apply - it should not change anything on newer Mac OS X versions.
Apparently you do actually use 10.4, but - I'm curious - why?
Mainly because I have some old Macs which are not supported by newer Mac OS X versions.
I'm curious again: Which ones would that be? 10.5 worked fine on my (recently deceased) PPC Mac...
iMac G4 800 MHz (the first flat-panel iMac). I guess there are also other examples of PPC Macs which would be still usable, but not supported by Apple. A.
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. I tried your patch, but it does not apply here. Please refresh it and address the above comment. Diego
Hi, 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. Benoît
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. Diego
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/b27... 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. */
On Thu, Jan 06, 2011 at 09:45:17PM +0200, Aaro Koskinen wrote:
On Wed, 5 Jan 2011, Diego Biurrun wrote:
On Wed, Jan 05, 2011 at 08:56:47PM +0100, Beno?t Amiaux wrote:
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).
The attached patch worked fine, I could not apply the inline variant. It is committed now, thank you. Diego
participants (6)
-
Aaro Koskinen -
Benoît Amiaux -
Carl Eugen Hoyos -
Diego Biurrun -
Reimar Döffinger -
Sean McGovern