Merge branch 'master' of git://github.com/Shyotl/SingularityViewer
Conflicts: indra/llaudio/llaudioengine.cpp
This commit is contained in:
@@ -1534,33 +1534,6 @@ bool LLAppViewer::cleanup()
|
||||
|
||||
llinfos << "Global stuff deleted" << llendflush;
|
||||
|
||||
if (gAudiop)
|
||||
{
|
||||
// shut down the streaming audio sub-subsystem first, in case it relies on not outliving the general audio subsystem.
|
||||
|
||||
LLStreamingAudioInterface *sai = gAudiop->getStreamingAudioImpl();
|
||||
delete sai;
|
||||
gAudiop->setStreamingAudioImpl(NULL);
|
||||
|
||||
// shut down the audio subsystem
|
||||
|
||||
bool want_longname = false;
|
||||
if (gAudiop->getDriverName(want_longname) == "FMOD")
|
||||
{
|
||||
// This hack exists because fmod likes to occasionally
|
||||
// crash or hang forever when shutting down, for no
|
||||
// apparent reason.
|
||||
llwarns << "Hack, skipping FMOD audio engine cleanup" << llendflush;
|
||||
}
|
||||
else
|
||||
{
|
||||
gAudiop->shutdown();
|
||||
}
|
||||
|
||||
delete gAudiop;
|
||||
gAudiop = NULL;
|
||||
}
|
||||
|
||||
// Note: this is where LLFeatureManager::getInstance()-> used to be deleted.
|
||||
|
||||
// Patch up settings for next time
|
||||
@@ -3942,6 +3915,9 @@ void LLAppViewer::idle()
|
||||
|
||||
gViewerWindow->updateUI();
|
||||
|
||||
//updateUI may have created sounds (clicks, etc). Call idleAudio to dispatch asap.
|
||||
idleAudio();
|
||||
|
||||
///////////////////////////////////////
|
||||
// Agent and camera movement
|
||||
//
|
||||
@@ -4120,22 +4096,6 @@ void LLAppViewer::idle()
|
||||
gObjectList.updateApparentAngles(gAgent);
|
||||
}
|
||||
|
||||
{
|
||||
gFrameStats.start(LLFrameStats::AUDIO);
|
||||
LLFastTimer t(FTM_AUDIO_UPDATE);
|
||||
|
||||
if (gAudiop)
|
||||
{
|
||||
audio_update_volume(false);
|
||||
audio_update_listener();
|
||||
audio_update_wind(false);
|
||||
|
||||
// this line actually commits the changes we've made to source positions, etc.
|
||||
const F32 max_audio_decode_time = 0.002f; // 2 ms decode time
|
||||
gAudiop->idle(max_audio_decode_time);
|
||||
}
|
||||
}
|
||||
|
||||
// Execute deferred tasks.
|
||||
LLDeferredTaskList::instance().run();
|
||||
|
||||
@@ -4440,6 +4400,51 @@ void LLAppViewer::idleNetwork()
|
||||
}
|
||||
}
|
||||
|
||||
void LLAppViewer::idleAudio()
|
||||
{
|
||||
gFrameStats.start(LLFrameStats::AUDIO);
|
||||
LLFastTimer t(FTM_AUDIO_UPDATE);
|
||||
|
||||
if (gAudiop)
|
||||
{
|
||||
audio_update_volume();
|
||||
audio_update_listener();
|
||||
|
||||
// this line actually commits the changes we've made to source positions, etc.
|
||||
const F32 max_audio_decode_time = 0.002f; // 2 ms decode time
|
||||
gAudiop->idle(max_audio_decode_time);
|
||||
}
|
||||
}
|
||||
void LLAppViewer::shutdownAudio()
|
||||
{
|
||||
if (gAudiop)
|
||||
{
|
||||
// shut down the streaming audio sub-subsystem first, in case it relies on not outliving the general audio subsystem.
|
||||
|
||||
LLStreamingAudioInterface *sai = gAudiop->getStreamingAudioImpl();
|
||||
delete sai;
|
||||
gAudiop->setStreamingAudioImpl(NULL);
|
||||
|
||||
// shut down the audio subsystem
|
||||
|
||||
bool want_longname = false;
|
||||
if (gAudiop->getDriverName(want_longname) == "FMOD")
|
||||
{
|
||||
// This hack exists because fmod likes to occasionally
|
||||
// crash or hang forever when shutting down, for no
|
||||
// apparent reason.
|
||||
llwarns << "Hack, skipping FMOD audio engine cleanup" << llendflush;
|
||||
}
|
||||
else
|
||||
{
|
||||
gAudiop->shutdown();
|
||||
}
|
||||
|
||||
delete gAudiop;
|
||||
gAudiop = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
void LLAppViewer::disconnectViewer()
|
||||
{
|
||||
if (gDisconnected)
|
||||
@@ -4540,6 +4545,9 @@ void LLAppViewer::disconnectViewer()
|
||||
LLDestroyClassList::instance().fireCallbacks();
|
||||
|
||||
cleanup_xfer_manager();
|
||||
|
||||
shutdownAudio();
|
||||
|
||||
gDisconnected = TRUE;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user