diff options
Diffstat (limited to 'Alc')
-rw-r--r-- | Alc/ALu.c | 2 | ||||
-rw-r--r-- | Alc/mixer.c | 10 |
2 files changed, 8 insertions, 4 deletions
@@ -1450,7 +1450,7 @@ static void CalcSourceParams(ALvoice *voice, ALCcontext *context, bool force) while(BufferListItem != NULL) { const ALbuffer *buffer; - if((buffer=BufferListItem->buffer) != NULL) + if(BufferListItem->num_buffers >= 1 && (buffer=BufferListItem->buffers[0]) != NULL) { if(props->SpatializeMode == SpatializeOn || (props->SpatializeMode == SpatializeAuto && buffer->FmtChannels == FmtMono)) diff --git a/Alc/mixer.c b/Alc/mixer.c index c77488bc..37bdf6ac 100644 --- a/Alc/mixer.c +++ b/Alc/mixer.c @@ -362,9 +362,13 @@ ALboolean MixSource(ALvoice *voice, ALsource *Source, ALCdevice *Device, ALsizei memcpy(SrcData, voice->PrevSamples[chan], MAX_PRE_SAMPLES*sizeof(ALfloat)); SrcDataSize = MAX_PRE_SAMPLES; + /* TODO: Handle multi-buffer items by adding them together in + * SrcData. Need to work out how to deal with looping (loop + * points). + */ if(isstatic) { - const ALbuffer *ALBuffer = BufferListItem->buffer; + const ALbuffer *ALBuffer = BufferListItem->buffers[0]; const ALubyte *Data = ALBuffer->data; ALsizei DataSize; @@ -421,7 +425,7 @@ ALboolean MixSource(ALvoice *voice, ALsource *Source, ALCdevice *Device, ALsizei while(tmpiter && SrcBufferSize > SrcDataSize) { const ALbuffer *ALBuffer; - if((ALBuffer=tmpiter->buffer) != NULL) + if(tmpiter->num_buffers >= 1 && (ALBuffer=tmpiter->buffers[0]) != NULL) { const ALubyte *Data = ALBuffer->data; ALsizei DataSize = ALBuffer->SampleLen; @@ -637,7 +641,7 @@ ALboolean MixSource(ALvoice *voice, ALsource *Source, ALCdevice *Device, ALsizei ALsizei LoopStart = 0; ALsizei LoopEnd = 0; - if((ALBuffer=BufferListItem->buffer) != NULL) + if(BufferListItem->num_buffers >= 1 && (ALBuffer=BufferListItem->buffers[0]) != NULL) { DataSize = ALBuffer->SampleLen; LoopStart = ALBuffer->LoopStart; |