diff options
author | Chris Robinson <[email protected]> | 2009-09-24 12:24:10 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2009-09-24 12:24:10 -0700 |
commit | af8e7ab98413ce569a12297c3a4103a9c65d1ced (patch) | |
tree | b03279ef3e82da10265b78481c936cfb9fa2ed37 | |
parent | 4289d5de7df8046c2b9207ae00314d5447fa57d9 (diff) |
Check the source start position in alSourcePlayv instead of the mixer
-rw-r--r-- | Alc/ALu.c | 4 | ||||
-rw-r--r-- | OpenAL32/alSource.c | 8 |
2 files changed, 8 insertions, 4 deletions
@@ -913,8 +913,9 @@ another_source: } /* Compute the gain steps for each output channel */ - if(ALSource->FirstStart && DataPosInt == 0 && DataPosFrac == 0) + if(ALSource->FirstStart) { + ALSource->FirstStart = AL_FALSE; for(i = 0;i < OUTPUTCHANNELS;i++) dryGainStep[i] = 0.0f; for(i = 0;i < MAX_SENDS;i++) @@ -933,7 +934,6 @@ another_source: WetSend[i] = ALSource->WetGains[i]; } } - ALSource->FirstStart = AL_FALSE; /* Compute 18.14 fixed point step */ if(Pitch > (float)MAX_PITCH) diff --git a/OpenAL32/alSource.c b/OpenAL32/alSource.c index 74591ff2..af263279 100644 --- a/OpenAL32/alSource.c +++ b/OpenAL32/alSource.c @@ -1325,7 +1325,6 @@ ALAPI ALvoid ALAPIENTRY alSourcePlayv(ALsizei n, const ALuint *pSourceList) pSource->position = 0; pSource->position_fraction = 0; pSource->BuffersPlayed = 0; - pSource->FirstStart = AL_TRUE; pSource->ulBufferID = pSource->queue->buffer; @@ -1342,13 +1341,18 @@ ALAPI ALvoid ALAPIENTRY alSourcePlayv(ALsizei n, const ALuint *pSourceList) pSource->state = AL_PLAYING; pSource->inuse = AL_TRUE; pSource->play = AL_TRUE; - pSource->FirstStart = AL_FALSE; } // Check if an Offset has been set if(pSource->lOffset) ApplyOffset(pSource, AL_FALSE); + if(pSource->BuffersPlayed == 0 && pSource->position == 0 && + pSource->position_fraction == 0) + pSource->FirstStart = AL_TRUE; + else + pSource->FirstStart = AL_FALSE; + // If device is disconnected, go right to stopped if(!pContext->Device->Connected) { |