update "fix a bug that SimpleAudioEngine may cause crash on i9100"

This commit is contained in:
waiter 2013-06-17 09:50:39 +08:00
parent 0d5b48eb9e
commit 3921512739
1 changed files with 5 additions and 2 deletions

View File

@ -95,15 +95,18 @@ unsigned int SimpleAudioEngineOpenSL::playEffect(const char* pszFilePath, bool b
if (s_pOpenSL->getEffectState(soundID) == PLAYSTATE_PLAYING)
{
// recreate an effect player
s_pOpenSL->recreatePlayer(pszFilePath);
if (s_pOpenSL->recreatePlayer(pszFilePath))
{
s_pOpenSL->setEffectLooping(soundID, bLoop);
}
}
else
{
s_pOpenSL->setEffectState(soundID, PLAYSTATE_STOPPED);
s_pOpenSL->setEffectState(soundID, PLAYSTATE_PLAYING);
s_pOpenSL->setEffectLooping(soundID, bLoop);
}
s_pOpenSL->setEffectLooping(soundID, bLoop);
}
return soundID;