From a396e5d88d1108b434ebedff0c60a1458f735cef Mon Sep 17 00:00:00 2001 From: Zack Middleton Date: Sun, 10 Nov 2013 23:28:54 -0600 Subject: 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. --- src/client/snd_openal.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/client') diff --git a/src/client/snd_openal.c b/src/client/snd_openal.c index fa18f2dc..403d013c 100644 --- a/src/client/snd_openal.c +++ b/src/client/snd_openal.c @@ -1536,6 +1536,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, @@ -1593,10 +1597,6 @@ void S_AL_SrcUpdate( void ) } curSfx->loopActiveCnt++; - - qalSourcei(curSource->alSource, AL_LOOPING, AL_TRUE); - curSource->isPlaying = qtrue; - qalSourcePlay(curSource->alSource); } // Update locality -- cgit