diff options
author | Chris Robinson <[email protected]> | 2011-02-06 01:07:37 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2011-02-06 01:07:37 -0800 |
commit | 6713a47d38470fb9b392729ad405d92ae9fcb9ab (patch) | |
tree | 3f819bcd282cf7bb295a3cb0071b152c7a159732 /Alc | |
parent | 02e0223fe8a2f80f296fe08c4e19b7cbf8062ff8 (diff) |
Fix looping on loop points
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 { |