From 628356a2942322656dc82c01f91cddec4ceb2a27 Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Sat, 15 Oct 2011 10:33:30 -0700 Subject: Set AL_STOPPED after setting AL_PLAYING when a source has nothing to play --- OpenAL32/alSource.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'OpenAL32/alSource.c') 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) -- cgit v1.2.3