aboutsummaryrefslogtreecommitdiffstats
path: root/OpenAL32/alSource.c
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2014-07-26 16:41:39 -0700
committerChris Robinson <[email protected]>2014-07-26 16:41:39 -0700
commitd3980bdebc379c104c406223e0d83e78b16bd791 (patch)
tree9050263e650dc1f083b9de091b7b2d554e0828c0 /OpenAL32/alSource.c
parent531c0d8e6b3d0ad8ff4ad8278a1030785deb3d77 (diff)
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.
Diffstat (limited to 'OpenAL32/alSource.c')
-rw-r--r--OpenAL32/alSource.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/OpenAL32/alSource.c b/OpenAL32/alSource.c
index d7859eff..9a4088a2 100644
--- a/OpenAL32/alSource.c
+++ b/OpenAL32/alSource.c
@@ -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)