Commit 25ed4371 authored by Ryan C. Gordon's avatar Ryan C. Gordon

Patched to compile.

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%404387
parent 896072b2
...@@ -258,11 +258,6 @@ outputCallback(void *inRefCon, ...@@ -258,11 +258,6 @@ outputCallback(void *inRefCon,
void *ptr; void *ptr;
UInt32 i; 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 */ /* Only do anything if audio is enabled and not paused */
if (!this->enabled || this->paused) { if (!this->enabled || this->paused) {
for (i = 0; i < ioData->mNumberBuffers; i++) { for (i = 0; i < ioData->mNumberBuffers; i++) {
...@@ -285,23 +280,25 @@ outputCallback(void *inRefCon, ...@@ -285,23 +280,25 @@ outputCallback(void *inRefCon,
remaining = abuf->mDataByteSize; remaining = abuf->mDataByteSize;
ptr = abuf->mData; ptr = abuf->mData;
while (remaining > 0) { while (remaining > 0) {
if (bufferOffset >= bufferSize) { if (this->hidden->bufferOffset >= this->hidden->bufferSize) {
/* Generate the data */ /* 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); SDL_mutexP(this->mixer_lock);
(*this->spec.callback)(this->spec.userdata, (*this->spec.callback)(this->spec.userdata,
buffer, bufferSize); this->hidden->buffer, this->hidden->bufferSize);
SDL_mutexV(this->mixer_lock); SDL_mutexV(this->mixer_lock);
bufferOffset = 0; this->hidden->bufferOffset = 0;
} }
len = bufferSize - bufferOffset; len = this->hidden->bufferSize - this->hidden->bufferOffset;
if (len > remaining) if (len > remaining)
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; ptr = (char *)ptr + len;
remaining -= len; remaining -= len;
bufferOffset += len; this->hidden->bufferOffset += len;
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment