summaryrefslogtreecommitdiff
path: root/indra/llaudio/llaudioengine.cpp
diff options
context:
space:
mode:
authorBrad Payne (Vir Linden) <vir@lindenlab.com>2012-06-26 16:43:58 -0400
committerBrad Payne (Vir Linden) <vir@lindenlab.com>2012-06-26 16:43:58 -0400
commit74d4f8af01358c0975351f90f044c03bc9c50c4c (patch)
tree72b8f043cd5787409718d1ca7be21ec32cf10657 /indra/llaudio/llaudioengine.cpp
parent52411f83a1e92d8449f68a6528f5b78e7c391553 (diff)
parent90547ff411db177bf6424ca553449a81a808fc0f (diff)
v-r to drano merge conflicts wip
Diffstat (limited to 'indra/llaudio/llaudioengine.cpp')
-rw-r--r--indra/llaudio/llaudioengine.cpp22
1 files changed, 14 insertions, 8 deletions
diff --git a/indra/llaudio/llaudioengine.cpp b/indra/llaudio/llaudioengine.cpp
index 5fa28cb902..72c0091d17 100644
--- a/indra/llaudio/llaudioengine.cpp
+++ b/indra/llaudio/llaudioengine.cpp
@@ -1221,10 +1221,11 @@ void LLAudioEngine::assetCallback(LLVFS *vfs, const LLUUID &uuid, LLAssetType::E
// 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
@@ -1237,6 +1238,7 @@ void LLAudioEngine::assetCallback(LLVFS *vfs, const LLUUID &uuid, LLAssetType::E
}
else
{
+ // llinfos << "Got asset callback with good audio data for " << uuid << ", making decode request" << llendl;
adp->setHasValidData(true);
adp->setHasLocalData(true);
gAudioDecodeMgrp->addDecodeRequest(uuid);
@@ -1304,16 +1306,18 @@ void LLAudioSource::update()
if (!getCurrentBuffer())
{
- if (getCurrentData())
+ LLAudioData *adp = getCurrentData();
+ if (adp)
{
// Hack - try and load the sound. Will do this as a callback
// on decode later.
- if (getCurrentData()->load() && getCurrentData()->getBuffer())
+ if (adp->load() && adp->getBuffer())
{
- play(getCurrentData()->getID());
+ play(adp->getID());
}
- else
+ else if (adp->hasCompletedDecode()) // Only mark corrupted after decode is done
{
+ llwarns << "Marking LLAudioSource corrupted for " << adp->getID() << llendl;
mCorrupted = true ;
}
}
@@ -1731,6 +1735,7 @@ LLAudioData::LLAudioData(const LLUUID &uuid) :
mBufferp(NULL),
mHasLocalData(false),
mHasDecodedData(false),
+ mHasCompletedDecode(false),
mHasValidData(true)
{
if (uuid.isNull())
@@ -1742,12 +1747,13 @@ LLAudioData::LLAudioData(const LLUUID &uuid) :
if (gAudiop && gAudiop->hasDecodedFile(uuid))
{
// Already have a decoded version, don't need to decode it.
- mHasLocalData = true;
- mHasDecodedData = true;
+ setHasLocalData(true);
+ setHasDecodedData(true);
+ setHasCompletedDecode(true);
}
else if (gAssetStorage && gAssetStorage->hasLocalAsset(uuid, LLAssetType::AT_SOUND))
{
- mHasLocalData = true;
+ setHasLocalData(true);
}
}