diff options
author | Chris Robinson <[email protected]> | 2009-12-09 11:56:53 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2009-12-09 11:56:53 -0800 |
commit | 368ef1cea9f2f17158ffebc70cab5c466652a176 (patch) | |
tree | 0452724efec727d496e9bf9112dbd900b1722d66 /Alc | |
parent | bd696a6b37c2d8d05c3917cde180c95bcdbb630a (diff) |
Store the source state locally after making sure it needs mixing
Diffstat (limited to 'Alc')
-rw-r--r-- | Alc/ALu.c | 14 |
1 files changed, 7 insertions, 7 deletions
@@ -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; |