aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/ALu.c
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2009-12-09 11:56:53 -0800
committerChris Robinson <[email protected]>2009-12-09 11:56:53 -0800
commit368ef1cea9f2f17158ffebc70cab5c466652a176 (patch)
tree0452724efec727d496e9bf9112dbd900b1722d66 /Alc/ALu.c
parentbd696a6b37c2d8d05c3917cde180c95bcdbb630a (diff)
Store the source state locally after making sure it needs mixing
Diffstat (limited to 'Alc/ALu.c')
-rw-r--r--Alc/ALu.c14
1 files changed, 7 insertions, 7 deletions
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;