aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/mixer.c
diff options
context:
space:
mode:
Diffstat (limited to 'Alc/mixer.c')
-rw-r--r--Alc/mixer.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/Alc/mixer.c b/Alc/mixer.c
index 6947e6e4..9aa9ad7d 100644
--- a/Alc/mixer.c
+++ b/Alc/mixer.c
@@ -255,7 +255,15 @@ ALvoid MixSource(ALactivesource *src, ALCdevice *Device, ALuint SamplesToDo)
pos = BufferPrePadding - DataPosInt;
while(pos > 0)
{
- if(!tmpiter->prev && !Looping)
+ ALbufferlistitem *prev;
+ if((prev=tmpiter->prev) != NULL)
+ tmpiter = prev;
+ else if(Looping)
+ {
+ while(tmpiter->next)
+ tmpiter = tmpiter->next;
+ }
+ else
{
ALuint DataSize = minu(SrcBufferSize - SrcDataSize, pos);
@@ -266,14 +274,6 @@ ALvoid MixSource(ALactivesource *src, ALCdevice *Device, ALuint SamplesToDo)
break;
}
- if(tmpiter->prev)
- tmpiter = tmpiter->prev;
- else
- {
- while(tmpiter->next)
- tmpiter = tmpiter->next;
- }
-
if(tmpiter->buffer)
{
if((ALuint)tmpiter->buffer->SampleLen > pos)