[MPlayer-dev-eng] [PATCH RESEND] Mac OS X: fix libao2 compilation on Mac OS X 10.4

Diego Biurrun diego at biurrun.de
Wed Dec 15 14:19:31 CET 2010


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


More information about the MPlayer-dev-eng mailing list