// static
void LLAudioEngine::assetCallback(LLVFS *vfs, const LLUUID &uuid, LLAssetType::EType type, void *user_data, S32 result_code, LLExtStat ext_status)
{
	if (result_code)
	{
		llinfos << "Boom, error in audio file transfer: " << LLAssetStorage::getErrorString( result_code ) << " (" << result_code << ")" << llendl;
		// Need to mark data as bad to avoid constant rerequests.
		LLAudioData *adp = gAudiop->getAudioData(uuid);
		if (adp)
        {
			adp->setHasValidData(false);
			adp->setHasLocalData(false);
			adp->setHasDecodedData(false);
		}
	}
	else
	{
		LLAudioData *adp = gAudiop->getAudioData(uuid);
		if (!adp)
        {
			// Should never happen
			llwarns << "Got asset callback without audio data for " << uuid << llendl;
        }
		else
		{
			adp->setHasValidData(true);
		    adp->setHasLocalData(true);
		    gAudioDecodeMgrp->addDecodeRequest(uuid);
		}
	}
	gAudiop->mCurrentTransfer = LLUUID::null;
	gAudiop->startNextTransfer();
}
示例#2
0
// static
void LLAudioEngine::assetCallback(LLVFS *vfs, const LLUUID &uuid, LLAssetType::EType type, void *user_data, S32 result_code, LLExtStat ext_status)
{
	if (!gAudiop)
	{
		LL_WARNS("AudioEngine") << "LLAudioEngine instance doesn't exist!" << LL_ENDL;
		return;
	}

	if (result_code)
	{
		LL_INFOS() << "Boom, error in audio file transfer: " << LLAssetStorage::getErrorString( result_code ) << " (" << result_code << ")" << LL_ENDL;
		// Need to mark data as bad to avoid constant rerequests.
		LLAudioData *adp = gAudiop->getAudioData(uuid);
		if (adp)
        {	// Make sure everything is cleared
			adp->setHasValidData(false);
			adp->setHasLocalData(false);
			adp->setHasDecodedData(false);
			adp->setHasCompletedDecode(true);
		}
	}
	else
	{
		LLAudioData *adp = gAudiop->getAudioData(uuid);
		if (!adp)
        {
			// Should never happen
			LL_WARNS() << "Got asset callback without audio data for " << uuid << LL_ENDL;
        }
		else
		{
			// LL_INFOS() << "Got asset callback with good audio data for " << uuid << ", making decode request" << LL_ENDL;
			adp->setHasValidData(true);
		    adp->setHasLocalData(true);
		    gAudioDecodeMgrp->addDecodeRequest(uuid);
		}
	}
	gAudiop->mCurrentTransfer = LLUUID::null;
	gAudiop->startNextTransfer();
}