diff options
Diffstat (limited to 'Alc')
-rw-r--r-- | Alc/mixer.c | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/Alc/mixer.c b/Alc/mixer.c index e777dd15..a5300d01 100644 --- a/Alc/mixer.c +++ b/Alc/mixer.c @@ -759,12 +759,22 @@ ALvoid MixSource(ALsource *Source, ALCdevice *Device, ALuint SamplesToDo) if((ALBuffer=BufferListItem->buffer) != NULL) { DataSize = ALBuffer->size / FrameSize; - if(DataSize > DataPosInt) - break; LoopStart = ALBuffer->LoopStart; LoopEnd = ALBuffer->LoopEnd; + if(LoopEnd > DataPosInt) + break; + } + + if(Looping && Source->lSourceType == AL_STATIC) + { + BufferListItem = Source->queue; + DataPosInt = ((DataPosInt-LoopStart)%(LoopEnd-LoopStart)) + LoopStart; + break; } + if(DataSize > DataPosInt) + break; + if(BufferListItem->next) { BufferListItem = BufferListItem->next; @@ -774,11 +784,6 @@ ALvoid MixSource(ALsource *Source, ALCdevice *Device, ALuint SamplesToDo) { BufferListItem = Source->queue; BuffersPlayed = 0; - if(Source->lSourceType == AL_STATIC) - { - DataPosInt = ((DataPosInt-LoopStart)%(LoopEnd-LoopStart)) + LoopStart; - break; - } } else { |