V2 llaudio merge

This commit is contained in:
Shyotl
2011-02-21 02:02:24 -06:00
parent ef0319ec1b
commit 81158d1e79
9 changed files with 87 additions and 20 deletions

View File

@@ -104,7 +104,11 @@ void LLAudioEngine::setDefaults()
}
mMasterGain = 1.f;
mInternalGain = 0.f;
// Setting mInternalGain to an out of range value fixes the issue reported in STORM-830.
// There is an edge case in setMasterGain during startup which prevents setInternalGain from
// being called if the master volume setting and mInternalGain both equal 0, so using -1 forces
// the if statement in setMasterGain to execute when the viewer starts up.
mInternalGain = -1.f;
mNextWindUpdate = 0.f;
mStreamingAudioImpl = NULL;
@@ -204,12 +208,12 @@ void LLAudioEngine::updateInternetStream()
}
// virtual
int LLAudioEngine::isInternetStreamPlaying()
LLAudioEngine::LLAudioPlayState LLAudioEngine::isInternetStreamPlaying()
{
if (mStreamingAudioImpl)
return mStreamingAudioImpl->isPlaying();
return (LLAudioEngine::LLAudioPlayState) mStreamingAudioImpl->isPlaying();
return 0; // Stopped
return LLAudioEngine::AUDIO_STOPPED; // Stopped
}
@@ -594,7 +598,7 @@ LLAudioBuffer * LLAudioEngine::getFreeBuffer()
if (buffer_id >= 0)
{
llinfos << "Taking over unused buffer " << buffer_id << llendl;
lldebugs << "Taking over unused buffer " << buffer_id << llendl;
//llinfos << "Flushing unused buffer!" << llendl;
mBuffers[buffer_id]->mAudioDatap->mBufferp = NULL;
delete mBuffers[buffer_id];
@@ -1627,6 +1631,10 @@ bool LLAudioSource::hasPendingPreloads() const
LLAudioData *adp = iter->second;
// note: a bad UUID will forever be !hasDecodedData()
// but also !hasValidData(), hence the check for hasValidData()
if (!adp)
{
continue;
}
if (!adp->hasDecodedData() && adp->hasValidData())
{
// This source is still waiting for a preload