Set AL_STOPPED after setting AL_PLAYING when a source has nothing to play
This commit is contained in:
+8
-8
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user