summaryrefslogtreecommitdiff
path: root/indra/newview/llviewermedia.cpp
diff options
context:
space:
mode:
authorVadim Savchuk <vsavchuk@productengine.com>2010-04-29 15:24:09 +0300
committerVadim Savchuk <vsavchuk@productengine.com>2010-04-29 15:24:09 +0300
commit7d0769f3e1979d12b8cf55e0f5312fecade49bee (patch)
treebc35fbf959a358315358722943a4bfd7b213850c /indra/newview/llviewermedia.cpp
parent4eb741883cbee15e28272677bcb9b58dce85ee42 (diff)
parent8c3feea2a2f3bcb648f712f63ea9c4dab8aaa0c3 (diff)
Merge from default branch
--HG-- branch : product-engine
Diffstat (limited to 'indra/newview/llviewermedia.cpp')
-rw-r--r--indra/newview/llviewermedia.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/indra/newview/llviewermedia.cpp b/indra/newview/llviewermedia.cpp
index 3c0345df90..fd2bb0fdf9 100644
--- a/indra/newview/llviewermedia.cpp
+++ b/indra/newview/llviewermedia.cpp
@@ -1914,7 +1914,15 @@ void LLViewerMediaImpl::updateVolume()
{
if(mMediaSource)
{
- mMediaSource->setVolume(mRequestedVolume * LLViewerMedia::getVolume());
+ F32 attenuation_multiplier = 1.0;
+
+ if (mProximityDistance > 0)
+ {
+ // the attenuation multiplier should never be more than one since that would increase volume
+ attenuation_multiplier = llmin(1.0, gSavedSettings.getF32("MediaRollOffFactor")/mProximityDistance);
+ }
+
+ mMediaSource->setVolume(mRequestedVolume * LLViewerMedia::getVolume() * attenuation_multiplier);
}
}
@@ -2427,6 +2435,8 @@ void LLViewerMediaImpl::update()
}
else
{
+ updateVolume();
+
// If we didn't just create the impl, it may need to get cookie updates.
if(!sUpdatedCookies.empty())
{