diff options
author | Chris Robinson <[email protected]> | 2011-10-15 10:33:30 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2011-10-15 10:33:30 -0700 |
commit | 628356a2942322656dc82c01f91cddec4ceb2a27 (patch) | |
tree | dc51127856c6ada54acd2116850f5167d03bfe56 /OpenAL32/alSource.c | |
parent | 0fba3b0e1e0c71dce3b34295f1b7f805236641b8 (diff) |
Set AL_STOPPED after setting AL_PLAYING when a source has nothing to play
Diffstat (limited to 'OpenAL32/alSource.c')
-rw-r--r-- | OpenAL32/alSource.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/OpenAL32/alSource.c b/OpenAL32/alSource.c index 9080b46b..7d0aa978 100644 --- a/OpenAL32/alSource.c +++ b/OpenAL32/alSource.c @@ -1871,14 +1871,6 @@ ALvoid SetSourceState(ALsource *Source, ALCcontext *Context, ALenum state) BufferList = BufferList->next; } - /* If there's nothing to play, or device is disconnected, go right to - * stopped */ - if(!BufferList || !Context->Device->Connected) - { - SetSourceState(Source, Context, AL_STOPPED); - return; - } - if(Source->state != AL_PLAYING) { for(j = 0;j < MAXCHANNELS;j++) @@ -1907,6 +1899,14 @@ ALvoid SetSourceState(ALsource *Source, ALCcontext *Context, ALenum state) if(Source->lOffset != -1) ApplyOffset(Source); + /* If there's nothing to play, or device is disconnected, go right to + * stopped */ + if(!BufferList || !Context->Device->Connected) + { + SetSourceState(Source, Context, AL_STOPPED); + return; + } + for(j = 0;j < Context->ActiveSourceCount;j++) { if(Context->ActiveSources[j] == Source) |