Fix restoring loop sound position on OS X

The default OpenAL library on OS X errors AL_INVALID_VALUE for AL_SEC_OFFSET if source isn't playing.
This commit is contained in:
Zack Middleton 2013-11-10 23:28:54 -06:00
parent 5795be68f6
commit b3bd74fce7

View file

@ -1517,6 +1517,10 @@ void S_AL_SrcUpdate( void )
if(!curSource->isPlaying)
{
qalSourcei(curSource->alSource, AL_LOOPING, AL_TRUE);
curSource->isPlaying = qtrue;
qalSourcePlay(curSource->alSource);
if(curSource->priority == SRCPRI_AMBIENT)
{
// If there are other ambient looping sources with the same sound,
@ -1574,10 +1578,6 @@ void S_AL_SrcUpdate( void )
}
curSfx->loopActiveCnt++;
qalSourcei(curSource->alSource, AL_LOOPING, AL_TRUE);
curSource->isPlaying = qtrue;
qalSourcePlay(curSource->alSource);
}
// Update locality