Fixed a shutdown crash in LLAudioEngine::assetCallback, and fixed behavior when soundsource re-issues a sound whilst a sound is currently playing for same source. (LLAudioChannel[Impl]::play now re-starts sound if already playing)
This commit is contained in:
@@ -1249,6 +1249,9 @@ void LLAudioEngine::startNextTransfer()
|
||||
// static
|
||||
void LLAudioEngine::assetCallback(LLVFS *vfs, const LLUUID &uuid, LLAssetType::EType type, void *user_data, S32 result_code, LLExtStat ext_status)
|
||||
{
|
||||
if(!gAudiop)
|
||||
return;
|
||||
|
||||
if (result_code)
|
||||
{
|
||||
LL_INFOS("AudioEngine") << "Boom, error in audio file transfer: " << LLAssetStorage::getErrorString( result_code ) << " (" << result_code << ")" << LL_ENDL;
|
||||
@@ -1469,6 +1472,19 @@ bool LLAudioSource::play(const LLUUID &audio_uuid)
|
||||
return true;
|
||||
}
|
||||
}
|
||||
else if(mCurrentDatap == adp) //Desired sound did not change. Just re-play it.
|
||||
{
|
||||
if(getChannel() && getChannel()->isPlaying())
|
||||
getChannel()->play();
|
||||
return true;
|
||||
}
|
||||
else //Desired sound did change. Release the old channel if set.
|
||||
{
|
||||
if(getChannel())
|
||||
getChannel()->cleanup();
|
||||
mPlayedOnce = false; //Reset the played flag so the new sound is actually started up.
|
||||
}
|
||||
|
||||
mCurrentDatap = adp;
|
||||
|
||||
// Make sure the audio engine knows that we want to request this sound.
|
||||
|
||||
Reference in New Issue
Block a user