# HG changeset patch # User Ryan C. Gordon # Date 1263195236 0 # Node ID e474a820daebbe8390629c2e0190879c1240e96c # Parent 5ea5e4e6103f1757e9d547d7e53233a6f46ea7c7 Patched to compile. diff -r 5ea5e4e6103f -r e474a820daeb src/audio/macosx/SDL_coreaudio.c --- a/src/audio/macosx/SDL_coreaudio.c Sun Jan 10 19:09:57 2010 +0000 +++ b/src/audio/macosx/SDL_coreaudio.c Mon Jan 11 07:33:56 2010 +0000 @@ -258,11 +258,6 @@ void *ptr; UInt32 i; - /* Is there ever more than one buffer, and what do you do with it? */ - if (ioDataList->mNumberBuffers != 1) { - return noErr; - } - /* Only do anything if audio is enabled and not paused */ if (!this->enabled || this->paused) { for (i = 0; i < ioData->mNumberBuffers; i++) { @@ -285,23 +280,25 @@ remaining = abuf->mDataByteSize; ptr = abuf->mData; while (remaining > 0) { - if (bufferOffset >= bufferSize) { + if (this->hidden->bufferOffset >= this->hidden->bufferSize) { /* Generate the data */ - SDL_memset(buffer, this->spec.silence, bufferSize); + SDL_memset(this->hidden->buffer, this->spec.silence, + this->hidden->bufferSize); SDL_mutexP(this->mixer_lock); (*this->spec.callback)(this->spec.userdata, - buffer, bufferSize); + this->hidden->buffer, this->hidden->bufferSize); SDL_mutexV(this->mixer_lock); - bufferOffset = 0; + this->hidden->bufferOffset = 0; } - len = bufferSize - bufferOffset; + len = this->hidden->bufferSize - this->hidden->bufferOffset; if (len > remaining) len = remaining; - SDL_memcpy(ptr, (char *)buffer + bufferOffset, len); + SDL_memcpy(ptr, (char *)this->hidden->buffer + + this->hidden->bufferOffset, len); ptr = (char *)ptr + len; remaining -= len; - bufferOffset += len; + this->hidden->bufferOffset += len; } }