aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Alc/ALu.c4
-rw-r--r--OpenAL32/alSource.c8
2 files changed, 8 insertions, 4 deletions
diff --git a/Alc/ALu.c b/Alc/ALu.c
index a2bcc968..7b108cfb 100644
--- a/Alc/ALu.c
+++ b/Alc/ALu.c
@@ -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)
{