Always set the active source's update method

If the source is stopped, changes its buffer, then played again quickly, the
source will never be removed from the active source list causing the update
method to remain as it was. If the buffer was changed between mono and multi-
channel, this causes it to use the wrong method.
This commit is contained in:
Chris Robinson
2014-07-26 16:41:39 -07:00
parent 531c0d8e6b
commit d3980bdebc
+7 -5
View File
@@ -2500,13 +2500,9 @@ ALvoid SetSourceState(ALsource *Source, ALCcontext *Context, ALenum state)
Context->ActiveSources[Context->ActiveSourceCount] = src;
}
memset(src, 0, sizeof(*src));
Context->ActiveSourceCount++;
src->Source = Source;
if(BufferList->buffer->FmtChannels == FmtMono)
src->Update = CalcSourceParams;
else
src->Update = CalcNonAttnSourceParams;
Context->ActiveSourceCount++;
}
else
{
@@ -2530,6 +2526,12 @@ ALvoid SetSourceState(ALsource *Source, ALCcontext *Context, ALenum state)
src->Send[i].Moving = AL_FALSE;
}
}
if(BufferList->buffer->FmtChannels == FmtMono)
src->Update = CalcSourceParams;
else
src->Update = CalcNonAttnSourceParams;
ATOMIC_STORE(&Source->NeedsUpdate, AL_TRUE);
}
else if(state == AL_PAUSED)