From 2487528a720315fbd93dab07929e73069702ada2 Mon Sep 17 00:00:00 2001 From: jsambuo Date: Sun, 3 Mar 2013 04:27:03 -0500 Subject: [PATCH] fixing bug where SimpleAudioEngine::playEffect() and SimpleAudioEngine::playBackgroundMusic() on linux plays twice --- CocosDenshion/linux/FmodAudioPlayer.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CocosDenshion/linux/FmodAudioPlayer.cpp b/CocosDenshion/linux/FmodAudioPlayer.cpp index 6461a8ff4e..58ab8e9a2e 100644 --- a/CocosDenshion/linux/FmodAudioPlayer.cpp +++ b/CocosDenshion/linux/FmodAudioPlayer.cpp @@ -173,7 +173,7 @@ void FmodAudioPlayer::playBackgroundMusic(const char* pszFilePath, bool bLoop) { FMOD_RESULT result = pSystem->playSound(FMOD_CHANNEL_FREE, pMusic, true, &pBGMChannel); if (!ERRCHECK(result)) { - pBGMChannel->setLoopCount((bLoop) ? -1 : 1); + pBGMChannel->setLoopCount((bLoop) ? -1 : 0); result = pBGMChannel->setPaused(false); } } @@ -313,7 +313,7 @@ unsigned int FmodAudioPlayer::playEffect(const char* pszFilePath, bool bLoop) { pChannel->setChannelGroup(pChannelGroup); //set its loop - pChannel->setLoopCount((bLoop) ? -1 : 1); + pChannel->setLoopCount((bLoop) ? -1 : 0); result = pChannel->setPaused(false); mapEffectSoundChannel[iSoundChannelCount] = pChannel;