mirror of https://github.com/axmolengine/axmol.git
fixing bug where SimpleAudioEngine::playEffect() and SimpleAudioEngine::playBackgroundMusic() on linux plays twice
This commit is contained in:
parent
473538f6a8
commit
2487528a72
|
@ -173,7 +173,7 @@ void FmodAudioPlayer::playBackgroundMusic(const char* pszFilePath, bool bLoop) {
|
||||||
FMOD_RESULT result = pSystem->playSound(FMOD_CHANNEL_FREE, pMusic, true,
|
FMOD_RESULT result = pSystem->playSound(FMOD_CHANNEL_FREE, pMusic, true,
|
||||||
&pBGMChannel);
|
&pBGMChannel);
|
||||||
if (!ERRCHECK(result)) {
|
if (!ERRCHECK(result)) {
|
||||||
pBGMChannel->setLoopCount((bLoop) ? -1 : 1);
|
pBGMChannel->setLoopCount((bLoop) ? -1 : 0);
|
||||||
result = pBGMChannel->setPaused(false);
|
result = pBGMChannel->setPaused(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -313,7 +313,7 @@ unsigned int FmodAudioPlayer::playEffect(const char* pszFilePath, bool bLoop) {
|
||||||
pChannel->setChannelGroup(pChannelGroup);
|
pChannel->setChannelGroup(pChannelGroup);
|
||||||
|
|
||||||
//set its loop
|
//set its loop
|
||||||
pChannel->setLoopCount((bLoop) ? -1 : 1);
|
pChannel->setLoopCount((bLoop) ? -1 : 0);
|
||||||
result = pChannel->setPaused(false);
|
result = pChannel->setPaused(false);
|
||||||
|
|
||||||
mapEffectSoundChannel[iSoundChannelCount] = pChannel;
|
mapEffectSoundChannel[iSoundChannelCount] = pChannel;
|
||||||
|
|
Loading…
Reference in New Issue