aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/ALu.c
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2008-01-21 14:33:42 -0800
committerChris Robinson <[email protected]>2008-01-21 14:33:42 -0800
commitf3dddb5e99335e0cbfd178a02df0087db415e5de (patch)
tree88acb065fc43dffed67a968cd333fe991c692dc3 /Alc/ALu.c
parent9a5e892cad7b71fd38ebfede9c923f2804806bd7 (diff)
Remove unnecessary duplicate thunk lookups
Diffstat (limited to 'Alc/ALu.c')
-rw-r--r--Alc/ALu.c18
1 files changed, 8 insertions, 10 deletions
diff --git a/Alc/ALu.c b/Alc/ALu.c
index 1d202f54..8a5ae3de 100644
--- a/Alc/ALu.c
+++ b/Alc/ALu.c
@@ -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);
}
}
}