Check the source start position in alSourcePlayv instead of the mixer

This commit is contained in:
Chris Robinson
2009-09-24 12:24:10 -07:00
parent 4289d5de7d
commit af8e7ab984
2 changed files with 8 additions and 4 deletions
+2 -2
View File
@@ -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)
+6 -2
View File
@@ -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)
{