Index: configure =================================================================== --- configure (revision 21561) +++ configure (working copy) @@ -4929,16 +4929,27 @@ if test "$_openal" = auto ; then _openal=no cat > $TMPC << EOF +#ifdef MACOSX +#include +#else #include +#endif int main(void) { alSourceQueueBuffers(0, 0, 0); // alGetSourcei(0, AL_SAMPLE_OFFSET, 0); return 0; } EOF - if cc_check -lopenal ; then - _libs_mplayer="$_libs_mplayer -lopenal" - _openal=yes + if test "$_macosx" = yes ; then + if cc_check -DMACOSX -framework OpenAL ; then + _ld_extra="$_ld_extra -framework OpenAL" + _openal=yes + fi + else + if cc_check -lopenal ; then + _libs_mplayer="$_libs_mplayer -lopenal" + _openal=yes + fi fi fi if test "$_openal" = yes ; then Index: libao2/ao_openal.c =================================================================== --- libao2/ao_openal.c (revision 21561) +++ libao2/ao_openal.c (working copy) @@ -10,10 +10,17 @@ #include #include #include + +#include "config.h" + +#ifdef MACOSX +#include +#include +#else #include #include +#endif -#include "config.h" #include "mp_msg.h" #include "help_mp.h" @@ -103,7 +110,7 @@ alSource3f(sources[0], AL_POSITION, 0, 0, 1); ao_data.channels = channels; alGetBufferi(buffers[0][0], AL_FREQUENCY, &bufrate); - ao_data.samplerate = rate = bufrate; + ao_data.samplerate = rate; ao_data.format = AF_FORMAT_S16_NE; ao_data.bps = channels * rate * 2; ao_data.buffersize = CHUNK_SIZE * NUM_BUF;