diff options
| author | Rye <rye@alchemyviewer.org> | 2025-08-27 23:07:22 -0400 |
|---|---|---|
| committer | Rye <rye@alchemyviewer.org> | 2025-08-27 23:07:22 -0400 |
| commit | 34ae3db498e0683b453c923fbff80b441810e96e (patch) | |
| tree | 27ce1dd3fd93c506f5503e89fb64f9d51a39601a /indra/newview/llviewerthrottle.cpp | |
| parent | 3f65a4bfec71a9950a541f9e6195a572a0622b48 (diff) | |
| parent | dae43ad532579e849aa191fba4fdb3478a455840 (diff) | |
Merge branch 'callum/viewer-cef-2025-08' into rye/infinitemac
Diffstat (limited to 'indra/newview/llviewerthrottle.cpp')
| -rw-r--r-- | indra/newview/llviewerthrottle.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/indra/newview/llviewerthrottle.cpp b/indra/newview/llviewerthrottle.cpp index 8d935e4243..3ccfbea6e2 100644 --- a/indra/newview/llviewerthrottle.cpp +++ b/indra/newview/llviewerthrottle.cpp @@ -225,7 +225,7 @@ void LLViewerThrottle::setMaxBandwidth(F32 kbits_per_second, bool from_event) void LLViewerThrottle::load() { - mMaxBandwidth = gSavedSettings.getF32("ThrottleBandwidthKBPS")*1024; + mMaxBandwidth = getMaxBandwidthKbps() * 1024; resetDynamicThrottle(); mCurrent.dump(); } @@ -242,6 +242,15 @@ void LLViewerThrottle::sendToSim() const mCurrent.sendToSim(); } +F32 LLViewerThrottle::getMaxBandwidthKbps() +{ + constexpr F32 MIN_BANDWIDTH = 100.0f; // 100 Kbps + constexpr F32 MAX_BANDWIDTH = 10000.0f; // 10 Mbps + + static LLCachedControl<F32> bandwidth(gSavedSettings, "ThrottleBandwidthKBPS", 3000.0); + return llclamp(bandwidth(), MIN_BANDWIDTH, MAX_BANDWIDTH); +} + LLViewerThrottleGroup LLViewerThrottle::getThrottleGroup(const F32 bandwidth_kbps) { |
