From 9b1ad6c873f5f2a633df856e9f9aa37f97c28882 Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Tue, 21 Sep 2010 19:49:47 -0700 Subject: [PATCH] Consolidate some code --- Alc/mixer.c | 25 ++++++++++++------------- 1 file 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) -- 2.11.4.GIT