Patched to compile.
authorRyan C. Gordon
Mon, 11 Jan 2010 07:33:56 +0000
changeset 3636e474a820daeb
parent 3635 5ea5e4e6103f
child 3637 8a46b3eab813
Patched to compile.
src/audio/macosx/SDL_coreaudio.c
     1.1 --- a/src/audio/macosx/SDL_coreaudio.c	Sun Jan 10 19:09:57 2010 +0000
     1.2 +++ b/src/audio/macosx/SDL_coreaudio.c	Mon Jan 11 07:33:56 2010 +0000
     1.3 @@ -258,11 +258,6 @@
     1.4      void *ptr;
     1.5      UInt32 i;
     1.6  
     1.7 -    /* Is there ever more than one buffer, and what do you do with it? */
     1.8 -    if (ioDataList->mNumberBuffers != 1) {
     1.9 -        return noErr;
    1.10 -    }
    1.11 -
    1.12      /* Only do anything if audio is enabled and not paused */
    1.13      if (!this->enabled || this->paused) {
    1.14          for (i = 0; i < ioData->mNumberBuffers; i++) {
    1.15 @@ -285,23 +280,25 @@
    1.16          remaining = abuf->mDataByteSize;
    1.17          ptr = abuf->mData;
    1.18          while (remaining > 0) {
    1.19 -            if (bufferOffset >= bufferSize) {
    1.20 +            if (this->hidden->bufferOffset >= this->hidden->bufferSize) {
    1.21                  /* Generate the data */
    1.22 -                SDL_memset(buffer, this->spec.silence, bufferSize);
    1.23 +                SDL_memset(this->hidden->buffer, this->spec.silence,
    1.24 +                           this->hidden->bufferSize);
    1.25                  SDL_mutexP(this->mixer_lock);
    1.26                  (*this->spec.callback)(this->spec.userdata,
    1.27 -                            buffer, bufferSize);
    1.28 +                            this->hidden->buffer, this->hidden->bufferSize);
    1.29                  SDL_mutexV(this->mixer_lock);
    1.30 -                bufferOffset = 0;
    1.31 +                this->hidden->bufferOffset = 0;
    1.32              }
    1.33  
    1.34 -            len = bufferSize - bufferOffset;
    1.35 +            len = this->hidden->bufferSize - this->hidden->bufferOffset;
    1.36              if (len > remaining)
    1.37                  len = remaining;
    1.38 -            SDL_memcpy(ptr, (char *)buffer + bufferOffset, len);
    1.39 +            SDL_memcpy(ptr, (char *)this->hidden->buffer +
    1.40 +                       this->hidden->bufferOffset, len);
    1.41              ptr = (char *)ptr + len;
    1.42              remaining -= len;
    1.43 -            bufferOffset += len;
    1.44 +            this->hidden->bufferOffset += len;
    1.45          }
    1.46      }
    1.47