diff options
author | Chris Robinson <[email protected]> | 2008-01-21 14:33:42 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2008-01-21 14:33:42 -0800 |
commit | f3dddb5e99335e0cbfd178a02df0087db415e5de (patch) | |
tree | 88acb065fc43dffed67a968cd333fe991c692dc3 /Alc/ALu.c | |
parent | 9a5e892cad7b71fd38ebfede9c923f2804806bd7 (diff) |
Remove unnecessary duplicate thunk lookups
Diffstat (limited to 'Alc/ALu.c')
-rw-r--r-- | Alc/ALu.c | 18 |
1 files changed, 8 insertions, 10 deletions
@@ -700,22 +700,20 @@ ALvoid aluMixData(ALCcontext *ALContext,ALvoid *buffer,ALsizei size,ALenum forma { if (BufferListItem->next) { - if(BufferListItem->next->buffer && - ((ALbuffer*)ALTHUNK_LOOKUPENTRY(BufferListItem->next->buffer))->data) + ALbuffer *NextBuf = (ALbuffer*)ALTHUNK_LOOKUPENTRY(BufferListItem->next->buffer); + if(NextBuf && NextBuf->data) { - ulExtraSamples = min(((ALbuffer*)ALTHUNK_LOOKUPENTRY(BufferListItem->next->buffer))->size, (ALint)(16*Channels)); - memcpy(&Data[DataSize*Channels], ((ALbuffer*)ALTHUNK_LOOKUPENTRY(BufferListItem->next->buffer))->data, ulExtraSamples); + ulExtraSamples = min(NextBuf->size, (ALint)(16*Channels)); + memcpy(&Data[DataSize*Channels], NextBuf->data, ulExtraSamples); } } else if (ALSource->bLooping) { - if (ALSource->queue->buffer) + ALbuffer *NextBuf = (ALbuffer*)ALTHUNK_LOOKUPENTRY(ALSource->queue->buffer); + if (NextBuf && NextBuf->data) { - if(((ALbuffer*)ALTHUNK_LOOKUPENTRY(ALSource->queue->buffer))->data) - { - ulExtraSamples = min(((ALbuffer*)ALTHUNK_LOOKUPENTRY(ALSource->queue->buffer))->size, (ALint)(16*Channels)); - memcpy(&Data[DataSize*Channels], ((ALbuffer*)ALTHUNK_LOOKUPENTRY(ALSource->queue->buffer))->data, ulExtraSamples); - } + ulExtraSamples = min(NextBuf->size, (ALint)(16*Channels)); + memcpy(&Data[DataSize*Channels], NextBuf->data, ulExtraSamples); } } } |