diff options
author | Chris Robinson <[email protected]> | 2010-09-21 19:49:47 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2010-09-21 19:49:47 -0700 |
commit | 9b1ad6c873f5f2a633df856e9f9aa37f97c28882 (patch) | |
tree | c3b0694b5df091a274963b3874ed9a97142e7588 /Alc | |
parent | 97daaade8a123a8bcac52752febbca9f1d43b0aa (diff) |
Consolidate some code
Diffstat (limited to 'Alc')
-rw-r--r-- | Alc/mixer.c | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/Alc/mixer.c b/Alc/mixer.c index 32dc7917..127df3a7 100644 --- a/Alc/mixer.c +++ b/Alc/mixer.c @@ -162,23 +162,22 @@ static void MixSource(ALsource *ALSource, ALCcontext *ALContext, Data = ALBuffer->data; DataSize = ALBuffer->size; DataSize /= aluFrameSizeFromFormat(ALBuffer->format); - LoopStart = ALBuffer->LoopStart; - LoopEnd = ALBuffer->LoopEnd; Channels = aluChannelsFromFormat(ALBuffer->format); Bytes = aluBytesFromFormat(ALBuffer->format); - } - if(Looping && ALSource->lSourceType == AL_STATIC) - { - /* If current offset is beyond the loop range, do not loop */ - if(DataPosInt >= LoopEnd) - Looping = AL_FALSE; - } - if(!Looping || ALSource->lSourceType != AL_STATIC) - { - /* Non-looping and non-static sources ignore loop points */ LoopStart = 0; - LoopEnd = DataSize; + LoopEnd = DataSize; + if(Looping && ALSource->lSourceType == AL_STATIC) + { + /* If current pos is beyond the loop range, do not loop */ + if(DataPosInt >= LoopEnd) + Looping = AL_FALSE; + else + { + LoopStart = ALBuffer->LoopStart; + LoopEnd = ALBuffer->LoopEnd; + } + } } if(DataPosInt >= DataSize) |