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:
+7
-5
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user