summaryrefslogtreecommitdiff
path: root/indra/newview/llviewermedia.cpp
diff options
context:
space:
mode:
authorAndreyL ProductEngine <alihatskiy@productengine.com>2019-05-08 21:41:56 +0300
committerAndreyL ProductEngine <alihatskiy@productengine.com>2019-05-08 21:41:56 +0300
commit3175525950ecf568eb75a6cb4f9283ee32dcd9a5 (patch)
treee7e28987b5618ffcf081a3ef0bdbb9717ccd1d6c /indra/newview/llviewermedia.cpp
parent9d2cb130e35fcbab98d5e7cb4d0d26ca6a16503b (diff)
parent34322f8f37380df868703051230f2a4109602b3f (diff)
Merged in lindenlab/viewer-release
Diffstat (limited to 'indra/newview/llviewermedia.cpp')
-rw-r--r--indra/newview/llviewermedia.cpp45
1 files changed, 39 insertions, 6 deletions
diff --git a/indra/newview/llviewermedia.cpp b/indra/newview/llviewermedia.cpp
index dd49dcccc2..8457c6856e 100644
--- a/indra/newview/llviewermedia.cpp
+++ b/indra/newview/llviewermedia.cpp
@@ -682,8 +682,8 @@ void LLViewerMedia::updateMedia(void *dummy_arg)
std::vector<LLViewerMediaImpl*> proximity_order;
- bool inworld_media_enabled = gSavedSettings.getBOOL("AudioStreamingMedia");
- bool inworld_audio_enabled = gSavedSettings.getBOOL("AudioStreamingMusic");
+ static LLCachedControl<bool> inworld_media_enabled(gSavedSettings, "AudioStreamingMedia", true);
+ static LLCachedControl<bool> inworld_audio_enabled(gSavedSettings, "AudioStreamingMusic", true);
U32 max_instances = gSavedSettings.getU32("PluginInstancesTotal");
U32 max_normal = gSavedSettings.getU32("PluginInstancesNormal");
U32 max_low = gSavedSettings.getU32("PluginInstancesLow");
@@ -941,7 +941,8 @@ void LLViewerMedia::setAllMediaEnabled(bool val)
LLViewerParcelMedia::play(LLViewerParcelMgr::getInstance()->getAgentParcel());
}
- if (gSavedSettings.getBOOL("AudioStreamingMusic") &&
+ static LLCachedControl<bool> audio_streaming_music(gSavedSettings, "AudioStreamingMusic", true);
+ if (audio_streaming_music &&
!LLViewerMedia::isParcelAudioPlaying() &&
gAudiop &&
LLViewerMedia::hasParcelAudio())
@@ -1012,7 +1013,8 @@ void LLViewerMedia::setAllMediaPaused(bool val)
LLViewerParcelMedia::play(LLViewerParcelMgr::getInstance()->getAgentParcel());
}
- if (gSavedSettings.getBOOL("AudioStreamingMusic") &&
+ static LLCachedControl<bool> audio_streaming_music(gSavedSettings, "AudioStreamingMusic", true);
+ if (audio_streaming_music &&
!LLViewerMedia::isParcelAudioPlaying() &&
gAudiop &&
LLViewerMedia::hasParcelAudio())
@@ -3318,8 +3320,39 @@ void LLViewerMediaImpl::handleMediaEvent(LLPluginClassMedia* plugin, LLPluginCla
}
else
{
- // Don't track redirects.
- setNavState(MEDIANAVSTATE_NONE);
+ bool internal_nav = false;
+ if (url != mCurrentMediaURL)
+ {
+ // Check if it is internal navigation
+ // Note: Not sure if we should detect internal navigations as 'address change',
+ // but they are not redirects and do not cause NAVIGATE_BEGIN (also see SL-1005)
+ size_t pos = url.find("#");
+ if (pos != std::string::npos)
+ {
+ // assume that new link always have '#', so this is either
+ // transfer from 'link#1' to 'link#2' or from link to 'link#2'
+ // filter out cases like 'redirect?link'
+ std::string base_url = url.substr(0, pos);
+ pos = mCurrentMediaURL.find(base_url);
+ if (pos == 0)
+ {
+ // base link hasn't changed
+ internal_nav = true;
+ }
+ }
+ }
+
+ if (internal_nav)
+ {
+ // Internal navigation by '#'
+ mCurrentMediaURL = url;
+ setNavState(MEDIANAVSTATE_FIRST_LOCATION_CHANGED);
+ }
+ else
+ {
+ // Don't track redirects.
+ setNavState(MEDIANAVSTATE_NONE);
+ }
}
}
break;