aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/ALu.c
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2009-10-22 09:31:26 -0700
committerChris Robinson <[email protected]>2009-10-22 09:31:26 -0700
commit921e7ac3e9a6ef7cb17dec920f44169658d93c6f (patch)
tree042e1a107303e724919d9a6ddfc8813a8b6c8d26 /Alc/ALu.c
parent8d807add41a1be8601b9d9a34052c4af450f103c (diff)
Store the buffer handle directly in the source and buffer queue list
Diffstat (limited to 'Alc/ALu.c')
-rw-r--r--Alc/ALu.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/Alc/ALu.c b/Alc/ALu.c
index 7d5d742b..d69285f1 100644
--- a/Alc/ALu.c
+++ b/Alc/ALu.c
@@ -853,16 +853,14 @@ another_source:
ALuint DataSize = 0;
ALuint DataPosInt = 0;
ALuint DataPosFrac = 0;
- ALuint Buffer;
ALbuffer *ALBuffer;
ALuint Channels, Bytes;
ALuint BufferSize;
ALfloat Pitch;
/* Get buffer info */
- if(!(Buffer = ALSource->ulBufferID))
+ if(!(ALBuffer = ALSource->Buffer))
goto skipmix;
- ALBuffer = (ALbuffer*)ALTHUNK_LOOKUPENTRY(Buffer);
Data = ALBuffer->data;
Channels = aluChannelsFromFormat(ALBuffer->format);
@@ -960,7 +958,7 @@ another_source:
if(BufferListItem->next)
{
- NextBuf = (ALbuffer*)ALTHUNK_LOOKUPENTRY(BufferListItem->next->buffer);
+ NextBuf = BufferListItem->next->buffer;
if(NextBuf && NextBuf->data)
{
ulExtraSamples = min(NextBuf->size, (ALint)(ALBuffer->padding*Channels*Bytes));
@@ -969,7 +967,7 @@ another_source:
}
else if(ALSource->bLooping)
{
- NextBuf = (ALbuffer*)ALTHUNK_LOOKUPENTRY(ALSource->queue->buffer);
+ NextBuf = ALSource->queue->buffer;
if(NextBuf && NextBuf->data)
{
ulExtraSamples = min(NextBuf->size, (ALint)(ALBuffer->padding*Channels*Bytes));
@@ -1122,7 +1120,7 @@ another_source:
skipmix:
/* Handle looping sources */
- if(!Buffer || DataPosInt >= DataSize)
+ if(!ALBuffer || DataPosInt >= DataSize)
{
/* Queueing */
if(ALSource->queue)
@@ -1138,7 +1136,7 @@ another_source:
BufferListItem = BufferListItem->next;
}
if(BufferListItem)
- ALSource->ulBufferID = BufferListItem->buffer;
+ ALSource->Buffer = BufferListItem->buffer;
ALSource->position = DataPosInt-DataSize;
ALSource->position_fraction = DataPosFrac;
ALSource->BuffersPlayed++;
@@ -1171,7 +1169,7 @@ another_source:
BufferListItem->bufferstate = PENDING;
BufferListItem = BufferListItem->next;
}
- ALSource->ulBufferID = ALSource->queue->buffer;
+ ALSource->Buffer = ALSource->queue->buffer;
if(ALSource->BuffersInQueue == 1)
ALSource->position = DataPosInt%DataSize;