From 368ef1cea9f2f17158ffebc70cab5c466652a176 Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Wed, 9 Dec 2009 11:56:53 -0800 Subject: Store the source state locally after making sure it needs mixing --- Alc/ALu.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'Alc') diff --git a/Alc/ALu.c b/Alc/ALu.c index fb4757c4..9b4471a6 100644 --- a/Alc/ALu.c +++ b/Alc/ALu.c @@ -904,8 +904,7 @@ static void MixSomeSources(ALCcontext *ALContext, float (*DryBuffer)[OUTPUTCHANN rampLength = max(rampLength, SamplesToDo); another_source: - State = ALSource->state; - if(State != AL_PLAYING) + if(ALSource->state != AL_PLAYING) { if((ALSource=ALSource->next) != NULL) goto another_source; @@ -931,11 +930,6 @@ another_source: BufferListItem = BufferListItem->next; } - /* Get source info */ - BuffersPlayed = ALSource->BuffersPlayed; - DataPosInt = ALSource->position; - DataPosFrac = ALSource->position_fraction; - if(ALSource->NeedsUpdate) { //Only apply 3D calculations for mono buffers @@ -946,6 +940,12 @@ another_source: ALSource->NeedsUpdate = AL_FALSE; } + /* Get source info */ + State = ALSource->state; + BuffersPlayed = ALSource->BuffersPlayed; + DataPosInt = ALSource->position; + DataPosFrac = ALSource->position_fraction; + /* Compute 18.14 fixed point step */ Pitch = (ALSource->Params.Pitch*Frequency) / DeviceFreq; if(Pitch > (float)MAX_PITCH) Pitch = (float)MAX_PITCH; -- cgit v1.2.3