From 1daac7272246416473942d05f1f700eb911ae942 Mon Sep 17 00:00:00 2001 From: Jonathan Yap Date: Wed, 15 Feb 2012 08:05:28 -0500 Subject: STORM-1812 Music stream does not always restart after teleporting --- indra/newview/llvieweraudio.cpp | 16 ++++++++++++++++ indra/newview/llvieweraudio.h | 2 ++ indra/newview/llviewerparcelmgr.cpp | 7 +++---- indra/newview/llviewerparcelmgr.h | 6 ++++-- 4 files changed, 25 insertions(+), 6 deletions(-) (limited to 'indra') 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()); } } } diff --git a/indra/newview/llvieweraudio.h b/indra/newview/llvieweraudio.h index a3da9fc6b8..d3a7d74de2 100644 --- a/indra/newview/llvieweraudio.h +++ b/indra/newview/llvieweraudio.h @@ -77,11 +77,13 @@ private: bool mIdleListnerActive; bool mForcedTeleportFade; boost::signals2::connection mTeleportFailedConnection; + boost::signals2::connection mTeleportFinishedConnection; void registerIdleListener(); void deregisterIdleListener() { mIdleListnerActive = false; }; void startFading(); void onTeleportFailed(); + void onTeleportFinished(const LLVector3d& pos, const bool& local); }; diff --git a/indra/newview/llviewerparcelmgr.cpp b/indra/newview/llviewerparcelmgr.cpp index 9db784101d..a89fafdc62 100644 --- a/indra/newview/llviewerparcelmgr.cpp +++ b/indra/newview/llviewerparcelmgr.cpp @@ -82,7 +82,6 @@ LLPointer sBlockedImage; LLPointer sPassImage; // Local functions -void optionally_start_music(const std::string& music_url); void callback_start_music(S32 option, void* data); void optionally_prepare_video(const LLParcel *parcelp); void callback_prepare_video(S32 option, void* data); @@ -1589,7 +1588,7 @@ void LLViewerParcelMgr::processParcelProperties(LLMessageSystem *msg, void **use if (instance->mTeleportInProgress) { instance->mTeleportInProgress = FALSE; - instance->mTeleportFinishedSignal(gAgent.getPositionGlobal()); + instance->mTeleportFinishedSignal(gAgent.getPositionGlobal(), false); } } } @@ -1773,7 +1772,7 @@ void LLViewerParcelMgr::processParcelProperties(LLMessageSystem *msg, void **use }; } -void optionally_start_music(const std::string& music_url) +void LLViewerParcelMgr::optionally_start_music(const std::string& music_url) { if (gSavedSettings.getBOOL("AudioStreamingMusic")) { @@ -2559,7 +2558,7 @@ void LLViewerParcelMgr::onTeleportFinished(bool local, const LLVector3d& new_pos { // Local teleport. We already have the agent parcel data. // Emit the signal immediately. - getInstance()->mTeleportFinishedSignal(new_pos); + getInstance()->mTeleportFinishedSignal(new_pos, local); } else { diff --git a/indra/newview/llviewerparcelmgr.h b/indra/newview/llviewerparcelmgr.h index cac8d8391c..2a11549426 100644 --- a/indra/newview/llviewerparcelmgr.h +++ b/indra/newview/llviewerparcelmgr.h @@ -78,8 +78,8 @@ class LLViewerParcelMgr : public LLSingleton { public: - typedef boost::function teleport_finished_callback_t; - typedef boost::signals2::signal teleport_finished_signal_t; + typedef boost::function teleport_finished_callback_t; + typedef boost::signals2::signal teleport_finished_signal_t; typedef boost::function parcel_changed_callback_t; typedef boost::signals2::signal parcel_changed_signal_t; @@ -275,6 +275,8 @@ public: // *NOTE: Taken out 2005-03-21. Phoenix. //void makeLandmarkAtSelection(); + static void optionally_start_music(const std::string& music_url); + static void processParcelOverlay(LLMessageSystem *msg, void **user_data); static void processParcelProperties(LLMessageSystem *msg, void **user_data); static void processParcelAccessListReply(LLMessageSystem *msg, void **user); -- cgit v1.2.3 From 502e89971f8cf22c49e9c42c38f0aee54a0654c5 Mon Sep 17 00:00:00 2001 From: Jonathan Yap Date: Mon, 14 May 2012 13:20:06 -0400 Subject: STORM-1812 Tweak how music is restarted for teleport within a parcel --- indra/newview/llpanelnearbymedia.cpp | 2 +- indra/newview/llvieweraudio.cpp | 2 +- indra/newview/llviewerparcelmgr.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'indra') diff --git a/indra/newview/llpanelnearbymedia.cpp b/indra/newview/llpanelnearbymedia.cpp index c01adc3c35..a50d9074f7 100644 --- a/indra/newview/llpanelnearbymedia.cpp +++ b/indra/newview/llpanelnearbymedia.cpp @@ -176,7 +176,7 @@ void LLPanelNearByMedia::handleMediaAutoPlayChanged(const LLSD& newvalue) { // update mParcelAudioAutoStart if AUTO_PLAY_MEDIA_SETTING changes mParcelAudioAutoStart = gSavedSettings.getBOOL(LLViewerMedia::AUTO_PLAY_MEDIA_SETTING) && - gSavedSettings.getBOOL("MediaTentativeAutoPlay"); + gSavedSettings.getBOOL("MediaTentativeAutoPlay"); } /*virtual*/ diff --git a/indra/newview/llvieweraudio.cpp b/indra/newview/llvieweraudio.cpp index 0114c292dc..c04e6eeb5c 100644 --- a/indra/newview/llvieweraudio.cpp +++ b/indra/newview/llvieweraudio.cpp @@ -268,7 +268,7 @@ void LLViewerAudio::onTeleportFinished(const LLVector3d& pos, const bool& local) LLParcel* parcel = LLViewerParcelMgr::getInstance()->getAgentParcel(); if (parcel) { - LLViewerParcelMgr::optionally_start_music(parcel->getMusicURL()); + mNextStreamURI = parcel->getMusicURL(); } } } diff --git a/indra/newview/llviewerparcelmgr.cpp b/indra/newview/llviewerparcelmgr.cpp index a89fafdc62..ae9c31bfe7 100644 --- a/indra/newview/llviewerparcelmgr.cpp +++ b/indra/newview/llviewerparcelmgr.cpp @@ -1778,7 +1778,7 @@ void LLViewerParcelMgr::optionally_start_music(const std::string& music_url) { // only play music when you enter a new parcel if the UI control for this // was not *explicitly* stopped by the user. (part of SL-4878) - LLPanelNearByMedia* nearby_media_panel = gStatusBar->getNearbyMediaPanel();; + LLPanelNearByMedia* nearby_media_panel = gStatusBar->getNearbyMediaPanel(); if ((nearby_media_panel && nearby_media_panel->getParcelAudioAutoStart()) || // or they have expressed no opinion in the UI, but have autoplay on... -- cgit v1.2.3 From 031c3bbcc4c1fdba9b8a2c797ebcac03310df93b Mon Sep 17 00:00:00 2001 From: Jonathan Yap Date: Fri, 18 May 2012 16:36:11 -0400 Subject: STORM-1812 / subtask STORM-1861 Media auto-play is off - but music stream starts to play anyway when teleport fails --- indra/newview/llvieweraudio.cpp | 21 +++++++++++++++++---- indra/newview/llvieweraudio.h | 2 ++ 2 files changed, 19 insertions(+), 4 deletions(-) (limited to 'indra') diff --git a/indra/newview/llvieweraudio.cpp b/indra/newview/llvieweraudio.cpp index c04e6eeb5c..9953bc1f36 100644 --- a/indra/newview/llvieweraudio.cpp +++ b/indra/newview/llvieweraudio.cpp @@ -49,7 +49,8 @@ LLViewerAudio::LLViewerAudio() : mFadeState(FADE_IDLE), mFadeTime(), mIdleListnerActive(false), - mForcedTeleportFade(false) + mForcedTeleportFade(false), + mWasPlaying(false) { mTeleportFailedConnection = LLViewerParcelMgr::getInstance()-> setTeleportFailedCallback(boost::bind(&LLViewerAudio::onTeleportFailed, this)); @@ -250,7 +251,7 @@ F32 LLViewerAudio::getFadeVolume() void LLViewerAudio::onTeleportFailed() { - if (gAudiop) + if (gAudiop && mWasPlaying) { LLParcel* parcel = LLViewerParcelMgr::getInstance()->getAgentParcel(); if (parcel) @@ -259,11 +260,12 @@ void LLViewerAudio::onTeleportFailed() llinfos << "Teleport failed -- resetting music stream" << llendl; } } + mWasPlaying = false; } void LLViewerAudio::onTeleportFinished(const LLVector3d& pos, const bool& local) { - if (gAudiop && local) + if (gAudiop && local && mWasPlaying) { LLParcel* parcel = LLViewerParcelMgr::getInstance()->getAgentParcel(); if (parcel) @@ -271,6 +273,7 @@ void LLViewerAudio::onTeleportFinished(const LLVector3d& pos, const bool& local) mNextStreamURI = parcel->getMusicURL(); } } + mWasPlaying = false; } void init_audio() @@ -378,12 +381,22 @@ void audio_update_volume(bool force_update) { if (progress_view_visible && !LLViewerAudio::getInstance()->getForcedTeleportFade()) { + // Even though the music was turned off it was starting up (with autoplay disabled) occasionally + // after a failed teleport or after an intra-parcel teleport. + if (gAudiop->getInternetStreamURL().empty()) + { + LLViewerAudio::getInstance()->setWasPlaying(false); + } + else + { + LLViewerAudio::getInstance()->setWasPlaying(true); + } LLViewerAudio::getInstance()->setForcedTeleportFade(true); LLViewerAudio::getInstance()->startInternetStreamWithAutoFade(LLStringUtil::null); LLViewerAudio::getInstance()->setNextStreamURI(LLStringUtil::null); } - if (!progress_view_visible && LLViewerAudio::getInstance()->getForcedTeleportFade() == true) + if (!progress_view_visible && LLViewerAudio::getInstance()->getForcedTeleportFade()) { LLViewerAudio::getInstance()->setForcedTeleportFade(false); } diff --git a/indra/newview/llvieweraudio.h b/indra/newview/llvieweraudio.h index d3a7d74de2..38c977c605 100644 --- a/indra/newview/llvieweraudio.h +++ b/indra/newview/llvieweraudio.h @@ -66,6 +66,7 @@ public: bool getForcedTeleportFade() { return mForcedTeleportFade; }; void setForcedTeleportFade(bool fade) { mForcedTeleportFade = fade;} ; void setNextStreamURI(std::string stream) { mNextStreamURI = stream; } ; + void setWasPlaying(bool playing) { mWasPlaying = playing;} ; private: @@ -76,6 +77,7 @@ private: LLFrameTimer stream_fade_timer; bool mIdleListnerActive; bool mForcedTeleportFade; + bool mWasPlaying; boost::signals2::connection mTeleportFailedConnection; boost::signals2::connection mTeleportFinishedConnection; -- cgit v1.2.3 From 278d3b15e6f7ecd83e48bb5c7eac11f670776a72 Mon Sep 17 00:00:00 2001 From: Jonathan Yap Date: Sun, 20 May 2012 14:22:38 -0400 Subject: STORM-1812 Store playing state from an additional place. --- indra/newview/llvieweraudio.cpp | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) (limited to 'indra') diff --git a/indra/newview/llvieweraudio.cpp b/indra/newview/llvieweraudio.cpp index 9953bc1f36..542f16cbee 100644 --- a/indra/newview/llvieweraudio.cpp +++ b/indra/newview/llvieweraudio.cpp @@ -382,15 +382,9 @@ void audio_update_volume(bool force_update) if (progress_view_visible && !LLViewerAudio::getInstance()->getForcedTeleportFade()) { // Even though the music was turned off it was starting up (with autoplay disabled) occasionally - // after a failed teleport or after an intra-parcel teleport. - if (gAudiop->getInternetStreamURL().empty()) - { - LLViewerAudio::getInstance()->setWasPlaying(false); - } - else - { - LLViewerAudio::getInstance()->setWasPlaying(true); - } + // after a failed teleport or after an intra-parcel teleport. Also, the music sometimes was not + // restarting after a successful intra-parcel teleport. Setting mWasPlaying fixes these issues. + LLViewerAudio::getInstance()->setWasPlaying(!gAudiop->getInternetStreamURL().empty()); LLViewerAudio::getInstance()->setForcedTeleportFade(true); LLViewerAudio::getInstance()->startInternetStreamWithAutoFade(LLStringUtil::null); LLViewerAudio::getInstance()->setNextStreamURI(LLStringUtil::null); @@ -398,6 +392,7 @@ void audio_update_volume(bool force_update) if (!progress_view_visible && LLViewerAudio::getInstance()->getForcedTeleportFade()) { + LLViewerAudio::getInstance()->setWasPlaying(!gAudiop->getInternetStreamURL().empty()); LLViewerAudio::getInstance()->setForcedTeleportFade(false); } -- cgit v1.2.3 From b2434b2f5e6909d62a6bd0b942d554dcba3cd052 Mon Sep 17 00:00:00 2001 From: Jonathan Yap Date: Wed, 30 May 2012 14:23:43 -0400 Subject: STORM-1812 Add debugging lines and call audio_update to try to work around a possible race condition --- indra/newview/llvieweraudio.cpp | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) (limited to 'indra') diff --git a/indra/newview/llvieweraudio.cpp b/indra/newview/llvieweraudio.cpp index 542f16cbee..2ef159ff31 100644 --- a/indra/newview/llvieweraudio.cpp +++ b/indra/newview/llvieweraudio.cpp @@ -251,13 +251,17 @@ F32 LLViewerAudio::getFadeVolume() void LLViewerAudio::onTeleportFailed() { + // Calling audio_update_volume makes sure that the music stream is properly set to be restored to + // its previous value + audio_update_volume(false); + if (gAudiop && mWasPlaying) { LLParcel* parcel = LLViewerParcelMgr::getInstance()->getAgentParcel(); if (parcel) { mNextStreamURI = parcel->getMusicURL(); - llinfos << "Teleport failed -- resetting music stream" << llendl; + llinfos << "Teleport failed -- setting music stream to " << mNextStreamURI << llendl; } } mWasPlaying = false; @@ -265,12 +269,17 @@ void LLViewerAudio::onTeleportFailed() void LLViewerAudio::onTeleportFinished(const LLVector3d& pos, const bool& local) { + // Calling audio_update_volume makes sure that the music stream is properly set to be restored to + // its previous value + audio_update_volume(false); + if (gAudiop && local && mWasPlaying) { LLParcel* parcel = LLViewerParcelMgr::getInstance()->getAgentParcel(); if (parcel) { mNextStreamURI = parcel->getMusicURL(); + llinfos << "Intraparcel teleport -- setting music stream to " << mNextStreamURI << llendl; } } mWasPlaying = false; @@ -379,8 +388,16 @@ void audio_update_volume(bool force_update) // Streaming Music if (gAudiop) { + if (!progress_view_visible && LLViewerAudio::getInstance()->getForcedTeleportFade()) + { +LL_WARNS("FADING") << "DBG ForcedTeleportFade = true, WasPlaying = " << !gAudiop->getInternetStreamURL().empty() << " stream ='" << gAudiop->getInternetStreamURL() << "'" << LL_ENDL; + LLViewerAudio::getInstance()->setWasPlaying(!gAudiop->getInternetStreamURL().empty()); + LLViewerAudio::getInstance()->setForcedTeleportFade(false); + } + if (progress_view_visible && !LLViewerAudio::getInstance()->getForcedTeleportFade()) { +LL_WARNS("FADING") << "DBG ForcedTeleportFade = false, WasPlaying = " << !gAudiop->getInternetStreamURL().empty() << " stream ='" << gAudiop->getInternetStreamURL() << "'" << LL_ENDL; // Even though the music was turned off it was starting up (with autoplay disabled) occasionally // after a failed teleport or after an intra-parcel teleport. Also, the music sometimes was not // restarting after a successful intra-parcel teleport. Setting mWasPlaying fixes these issues. @@ -390,12 +407,6 @@ void audio_update_volume(bool force_update) LLViewerAudio::getInstance()->setNextStreamURI(LLStringUtil::null); } - if (!progress_view_visible && LLViewerAudio::getInstance()->getForcedTeleportFade()) - { - LLViewerAudio::getInstance()->setWasPlaying(!gAudiop->getInternetStreamURL().empty()); - LLViewerAudio::getInstance()->setForcedTeleportFade(false); - } - F32 music_volume = gSavedSettings.getF32("AudioLevelMusic"); BOOL music_muted = gSavedSettings.getBOOL("MuteMusic"); F32 fade_volume = LLViewerAudio::getInstance()->getFadeVolume(); -- cgit v1.2.3 From 29737cb9c00cc46059e3a77bce06d45e45fe4d9f Mon Sep 17 00:00:00 2001 From: Jonathan Yap Date: Wed, 30 May 2012 17:07:17 -0400 Subject: STORM-1812 First pass at adding teleport started signal --- indra/newview/llvieweraudio.cpp | 8 ++++++++ indra/newview/llvieweraudio.h | 3 ++- indra/newview/llviewermessage.cpp | 5 +++++ indra/newview/llviewermessage.h | 12 ++++++++++-- 4 files changed, 25 insertions(+), 3 deletions(-) (limited to 'indra') diff --git a/indra/newview/llvieweraudio.cpp b/indra/newview/llvieweraudio.cpp index 2ef159ff31..7ac0d3aeaa 100644 --- a/indra/newview/llvieweraudio.cpp +++ b/indra/newview/llvieweraudio.cpp @@ -41,6 +41,7 @@ #include "llstartup.h" #include "llviewerparcelmgr.h" #include "llparcel.h" +#include "llviewermessage.h" ///////////////////////////////////////////////////////// @@ -56,6 +57,8 @@ LLViewerAudio::LLViewerAudio() : setTeleportFailedCallback(boost::bind(&LLViewerAudio::onTeleportFailed, this)); mTeleportFinishedConnection = LLViewerParcelMgr::getInstance()-> setTeleportFinishedCallback(boost::bind(&LLViewerAudio::onTeleportFinished, this, _1, _2)); + mTeleportStartedConnection = LLViewerMessage::getInstance()-> + setTeleportStartedCallback(boost::bind(&LLViewerAudio::onTeleportStarted, this)); } LLViewerAudio::~LLViewerAudio() @@ -249,6 +252,11 @@ F32 LLViewerAudio::getFadeVolume() return fade_volume; } +void LLViewerAudio::onTeleportStarted() +{ +llwarns << "DBG teleport started" << llendl; +} + void LLViewerAudio::onTeleportFailed() { // Calling audio_update_volume makes sure that the music stream is properly set to be restored to diff --git a/indra/newview/llvieweraudio.h b/indra/newview/llvieweraudio.h index 38c977c605..8c302c6549 100644 --- a/indra/newview/llvieweraudio.h +++ b/indra/newview/llvieweraudio.h @@ -80,13 +80,14 @@ private: bool mWasPlaying; boost::signals2::connection mTeleportFailedConnection; boost::signals2::connection mTeleportFinishedConnection; + boost::signals2::connection mTeleportStartedConnection; void registerIdleListener(); void deregisterIdleListener() { mIdleListnerActive = false; }; void startFading(); void onTeleportFailed(); void onTeleportFinished(const LLVector3d& pos, const bool& local); - + void onTeleportStarted(); }; #endif //LL_VIEWER_H diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 3c6770df43..33ce8a79e1 100755 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -3441,6 +3441,11 @@ void process_teleport_start(LLMessageSystem *msg, void**) } } +boost::signals2::connection LLViewerMessage::setTeleportStartedCallback(teleport_started_callback_t cb) +{ + return mTeleportStartedSignal.connect(cb); +} + void process_teleport_progress(LLMessageSystem* msg, void**) { LLUUID agent_id; diff --git a/indra/newview/llviewermessage.h b/indra/newview/llviewermessage.h index d8acd99953..e4fc77c06d 100644 --- a/indra/newview/llviewermessage.h +++ b/indra/newview/llviewermessage.h @@ -204,6 +204,16 @@ bool highlight_offered_object(const LLUUID& obj_id); void set_dad_inventory_item(LLInventoryItem* inv_item, const LLUUID& into_folder_uuid); void set_dad_inbox_object(const LLUUID& object_id); +class LLViewerMessage : public LLSingleton +{ +public: + typedef boost::function teleport_started_callback_t; + typedef boost::signals2::signal teleport_started_signal_t; + boost::signals2::connection setTeleportStartedCallback(teleport_started_callback_t cb); + +protected: + teleport_started_signal_t mTeleportStartedSignal; +}; class LLOfferInfo : public LLNotificationResponderInterface { @@ -252,5 +262,3 @@ private: void process_feature_disabled_message(LLMessageSystem* msg, void**); #endif - - -- cgit v1.2.3 From 8e6202ad53415695f0c0f40a366b4f329ff8b714 Mon Sep 17 00:00:00 2001 From: Jonathan Yap Date: Thu, 31 May 2012 06:20:12 -0400 Subject: STORM-1812 Added teleport started callback --- indra/newview/llvieweraudio.cpp | 26 +++++++++++--------------- indra/newview/llviewermessage.cpp | 4 ++++ indra/newview/llviewermessage.h | 4 +++- 3 files changed, 18 insertions(+), 16 deletions(-) (limited to 'indra') diff --git a/indra/newview/llvieweraudio.cpp b/indra/newview/llvieweraudio.cpp index 7ac0d3aeaa..8d8c401dac 100644 --- a/indra/newview/llvieweraudio.cpp +++ b/indra/newview/llvieweraudio.cpp @@ -65,6 +65,7 @@ LLViewerAudio::~LLViewerAudio() { mTeleportFailedConnection.disconnect(); mTeleportFinishedConnection.disconnect(); + mTeleportStartedConnection.disconnect(); } void LLViewerAudio::registerIdleListener() @@ -74,7 +75,6 @@ void LLViewerAudio::registerIdleListener() mIdleListnerActive = true; doOnIdleRepeating(boost::bind(boost::bind(&LLViewerAudio::onIdleUpdate, this))); } - } void LLViewerAudio::startInternetStreamWithAutoFade(std::string streamURI) @@ -254,7 +254,16 @@ F32 LLViewerAudio::getFadeVolume() void LLViewerAudio::onTeleportStarted() { -llwarns << "DBG teleport started" << llendl; + if (!LLViewerAudio::getInstance()->getForcedTeleportFade()) + { + // Even though the music was turned off it was starting up (with autoplay disabled) occasionally + // after a failed teleport or after an intra-parcel teleport. Also, the music sometimes was not + // restarting after a successful intra-parcel teleport. Setting mWasPlaying fixes these issues. + LLViewerAudio::getInstance()->setWasPlaying(!gAudiop->getInternetStreamURL().empty()); + LLViewerAudio::getInstance()->setForcedTeleportFade(true); + LLViewerAudio::getInstance()->startInternetStreamWithAutoFade(LLStringUtil::null); + LLViewerAudio::getInstance()->setNextStreamURI(LLStringUtil::null); + } } void LLViewerAudio::onTeleportFailed() @@ -398,23 +407,10 @@ void audio_update_volume(bool force_update) { if (!progress_view_visible && LLViewerAudio::getInstance()->getForcedTeleportFade()) { -LL_WARNS("FADING") << "DBG ForcedTeleportFade = true, WasPlaying = " << !gAudiop->getInternetStreamURL().empty() << " stream ='" << gAudiop->getInternetStreamURL() << "'" << LL_ENDL; LLViewerAudio::getInstance()->setWasPlaying(!gAudiop->getInternetStreamURL().empty()); LLViewerAudio::getInstance()->setForcedTeleportFade(false); } - if (progress_view_visible && !LLViewerAudio::getInstance()->getForcedTeleportFade()) - { -LL_WARNS("FADING") << "DBG ForcedTeleportFade = false, WasPlaying = " << !gAudiop->getInternetStreamURL().empty() << " stream ='" << gAudiop->getInternetStreamURL() << "'" << LL_ENDL; - // Even though the music was turned off it was starting up (with autoplay disabled) occasionally - // after a failed teleport or after an intra-parcel teleport. Also, the music sometimes was not - // restarting after a successful intra-parcel teleport. Setting mWasPlaying fixes these issues. - LLViewerAudio::getInstance()->setWasPlaying(!gAudiop->getInternetStreamURL().empty()); - LLViewerAudio::getInstance()->setForcedTeleportFade(true); - LLViewerAudio::getInstance()->startInternetStreamWithAutoFade(LLStringUtil::null); - LLViewerAudio::getInstance()->setNextStreamURI(LLStringUtil::null); - } - F32 music_volume = gSavedSettings.getF32("AudioLevelMusic"); BOOL music_muted = gSavedSettings.getBOOL("MuteMusic"); F32 fade_volume = LLViewerAudio::getInstance()->getFadeVolume(); diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 33ce8a79e1..536d3d2056 100755 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -3417,6 +3417,9 @@ void process_teleport_start(LLMessageSystem *msg, void**) LL_DEBUGS("Messaging") << "Got TeleportStart with TeleportFlags=" << teleport_flags << ". gTeleportDisplay: " << gTeleportDisplay << ", gAgent.mTeleportState: " << gAgent.getTeleportState() << LL_ENDL; + // *NOTE: The server sends two StartTeleport packets when you are teleporting to a LM + LLViewerMessage::getInstance()->mTeleportStartedSignal(); + if (teleport_flags & TELEPORT_FLAGS_DISABLE_CANCEL) { gViewerWindow->setProgressCancelButtonVisible(FALSE); @@ -3436,6 +3439,7 @@ void process_teleport_start(LLMessageSystem *msg, void**) make_ui_sound("UISndTeleportOut"); LL_INFOS("Messaging") << "Teleport initiated by remote TeleportStart message with TeleportFlags: " << teleport_flags << LL_ENDL; + // Don't call LLFirstUse::useTeleport here because this could be // due to being killed, which would send you home, not to a Telehub } diff --git a/indra/newview/llviewermessage.h b/indra/newview/llviewermessage.h index e4fc77c06d..f326a5b29b 100644 --- a/indra/newview/llviewermessage.h +++ b/indra/newview/llviewermessage.h @@ -36,6 +36,9 @@ #include "stdenums.h" #include "llnotifications.h" +#include +#include + // // Forward declarations // @@ -211,7 +214,6 @@ public: typedef boost::signals2::signal teleport_started_signal_t; boost::signals2::connection setTeleportStartedCallback(teleport_started_callback_t cb); -protected: teleport_started_signal_t mTeleportStartedSignal; }; -- cgit v1.2.3