feat(webrtc): enable keyframe cache on video sources (issue #17)
Call videoSrc.EnableKeyFrameCache() immediately after binding the video UDP Source in allocAdjacentPair(). Audio sources are intentionally left uncached — IDR detection on Opus packets would accumulate the entire audio stream without ever resetting the burst.
This commit is contained in:
parent
020a1800ce
commit
7490edd770
1 changed files with 5 additions and 0 deletions
|
|
@ -141,6 +141,11 @@ func (s *Subsystem) allocAdjacentPair(id string) (int, *corewebrtc.Source, *core
|
|||
lastErr = err
|
||||
continue
|
||||
}
|
||||
// Activate IDR keyframe caching on the video source so that
|
||||
// late-joining WHEP peers receive a reference frame immediately
|
||||
// instead of waiting up to one full keyframe interval.
|
||||
videoSrc.EnableKeyFrameCache()
|
||||
|
||||
audioSrc, err := corewebrtc.NewSourceOn(id+":audio", "127.0.0.1", port+1)
|
||||
if err != nil {
|
||||
_ = videoSrc.Close()
|
||||
|
|
|
|||
Loading…
Reference in a new issue