mirror of
https://github.com/openlibrecommunity/olcrtc.git
synced 2026-06-01 22:18:52 +02:00
fix: bug lint
This commit is contained in:
+7
-7
@@ -125,8 +125,8 @@ func SetVP8Options(fps, batchSize int) {
|
||||
mu.Lock()
|
||||
defer mu.Unlock()
|
||||
ensureDefaultConfigLocked()
|
||||
defaults.vp8FPS = clamp(fps, 120)
|
||||
defaults.vp8BatchSize = clamp(batchSize, 64)
|
||||
defaults.vp8FPS = clamp(fps, 1, 120)
|
||||
defaults.vp8BatchSize = clamp(batchSize, 1, 64)
|
||||
}
|
||||
|
||||
// SetDebug enables or disables verbose logging.
|
||||
@@ -227,8 +227,8 @@ func Check(
|
||||
"",
|
||||
0,
|
||||
0,
|
||||
clamp(vp8FPS, 120),
|
||||
clamp(vp8BatchSize, 64),
|
||||
clamp(vp8FPS, 1, 120),
|
||||
clamp(vp8BatchSize, 1, 64),
|
||||
)
|
||||
}()
|
||||
|
||||
@@ -479,9 +479,9 @@ func buildRoomURL(carrierName, roomID string) string {
|
||||
}
|
||||
}
|
||||
|
||||
func clamp(value, maxValue int) int {
|
||||
if value < 1 {
|
||||
return 1
|
||||
func clamp(value, minValue, maxValue int) int {
|
||||
if value < minValue {
|
||||
return minValue
|
||||
}
|
||||
if value > maxValue {
|
||||
return maxValue
|
||||
|
||||
Reference in New Issue
Block a user