summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2010-11-06 14:07:30 -0700
committerChris Robinson <[email protected]>2010-11-06 14:07:30 -0700
commitc95f182a90a1b31188e3ab7e765e28e94212cfe6 (patch)
tree0a17093a9a6469d26d1f51aa62a90344291271ce
parent289c74788e33db600a4f9797fc40b9d5afb50bbe (diff)
Remove unnecessary comments and reorder some lines
-rw-r--r--OpenAL32/alSource.c21
1 files changed, 8 insertions, 13 deletions
diff --git a/OpenAL32/alSource.c b/OpenAL32/alSource.c
index f64bf9e6..3cb9242c 100644
--- a/OpenAL32/alSource.c
+++ b/OpenAL32/alSource.c
@@ -147,12 +147,10 @@ AL_API ALvoid AL_APIENTRY alDeleteSources(ALsizei n, const ALuint *sources)
while(Source->queue != NULL)
{
BufferList = Source->queue;
- // Decrement buffer's reference counter
+ Source->queue = BufferList->next;
+
if(BufferList->buffer != NULL)
BufferList->buffer->refcount--;
- // Update queue to point to next element in list
- Source->queue = BufferList->next;
- // Release memory allocated for buffer list item
free(BufferList);
}
@@ -535,17 +533,15 @@ AL_API ALvoid AL_APIENTRY alSourcei(ALuint source,ALenum eParam,ALint lValue)
{
BufferListItem = Source->queue;
Source->queue = BufferListItem->next;
- // Decrement reference counter for buffer
+
if(BufferListItem->buffer)
BufferListItem->buffer->refcount--;
- // Release memory for buffer list item
free(BufferListItem);
- // Decrement the number of buffers in the queue
- Source->BuffersInQueue--;
}
+ Source->BuffersInQueue = 0;
// Add the buffer to the queue (as long as it is NOT the NULL buffer)
- if(lValue != 0)
+ if(buffer != NULL)
{
// Source is now in STATIC mode
Source->lSourceType = AL_STATIC;
@@ -2094,12 +2090,10 @@ ALvoid ReleaseALSources(ALCcontext *Context)
while(temp->queue != NULL)
{
ALbufferlistitem *BufferList = temp->queue;
- // Decrement buffer's reference counter
+ temp->queue = BufferList->next;
+
if(BufferList->buffer != NULL)
BufferList->buffer->refcount--;
- // Update queue to point to next element in list
- temp->queue = BufferList->next;
- // Release memory allocated for buffer list item
free(BufferList);
}
@@ -2107,6 +2101,7 @@ ALvoid ReleaseALSources(ALCcontext *Context)
{
if(temp->Send[j].Slot)
temp->Send[j].Slot->refcount--;
+ temp->Send[j].Slot = NULL;
}
// Release source structure