mirror of
https://github.com/livekit/livekit.git
synced 2026-10-23 21:44:29 +00:00
set limit for maxVideoFrameCacheDuration to 2s.
This commit is contained in:
1 parent
84443e66e2
commit
089fb906cd
1 file changed
+14
@@ -93,8 +93,22 @@ func WithForwardStats(forwardStats *ForwardStats) ReceiverOpts {
|
||||
}
|
||||
}
|
||||
|
||||
// maxVideoFrameCacheDuration caps the video frame cache window: a longer cached interval would size
|
||||
// the retransmit bucket too aggressively and delay subscriber bootstrap, so requests above it are
|
||||
// clamped down.
|
||||
const maxVideoFrameCacheDuration = 2 * time.Second
|
||||
|
||||
func WithVideoFrameCache(maxDuration time.Duration) ReceiverOpts {
|
||||
return func(w *WebRTCReceiver) *WebRTCReceiver {
|
||||
if maxDuration > maxVideoFrameCacheDuration {
|
||||
w.ReceiverBase.Logger().Infow(
|
||||
"clamping video frame cache duration",
|
||||
"requested", maxDuration,
|
||||
"max", maxVideoFrameCacheDuration,
|
||||
)
|
||||
maxDuration = maxVideoFrameCacheDuration
|
||||
}
|
||||
|
||||
w.ReceiverBase.EnableVideoFrameCache(maxDuration)
|
||||
return w
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user