diff options
author | Jonathan Yap <none@none> | 2012-02-15 08:05:28 -0500 |
---|---|---|
committer | Jonathan Yap <none@none> | 2012-02-15 08:05:28 -0500 |
commit | 1daac7272246416473942d05f1f700eb911ae942 (patch) | |
tree | a1b9e79effe7423db85cfaf052abfa60454d4df0 /indra/newview/llvieweraudio.cpp | |
parent | 289d756ea86bd3898f41592146d8f549cd056846 (diff) |
STORM-1812 Music stream does not always restart after teleporting
Diffstat (limited to 'indra/newview/llvieweraudio.cpp')
-rw-r--r-- | indra/newview/llvieweraudio.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/indra/newview/llvieweraudio.cpp b/indra/newview/llvieweraudio.cpp index 2447f5dea8..0114c292dc 100644 --- a/indra/newview/llvieweraudio.cpp +++ b/indra/newview/llvieweraudio.cpp @@ -53,11 +53,14 @@ LLViewerAudio::LLViewerAudio() : { mTeleportFailedConnection = LLViewerParcelMgr::getInstance()-> setTeleportFailedCallback(boost::bind(&LLViewerAudio::onTeleportFailed, this)); + mTeleportFinishedConnection = LLViewerParcelMgr::getInstance()-> + setTeleportFinishedCallback(boost::bind(&LLViewerAudio::onTeleportFinished, this, _1, _2)); } LLViewerAudio::~LLViewerAudio() { mTeleportFailedConnection.disconnect(); + mTeleportFinishedConnection.disconnect(); } void LLViewerAudio::registerIdleListener() @@ -253,6 +256,19 @@ void LLViewerAudio::onTeleportFailed() if (parcel) { mNextStreamURI = parcel->getMusicURL(); + llinfos << "Teleport failed -- resetting music stream" << llendl; + } + } +} + +void LLViewerAudio::onTeleportFinished(const LLVector3d& pos, const bool& local) +{ + if (gAudiop && local) + { + LLParcel* parcel = LLViewerParcelMgr::getInstance()->getAgentParcel(); + if (parcel) + { + LLViewerParcelMgr::optionally_start_music(parcel->getMusicURL()); } } } |