From 39d0af43816d14b9266173d9b5a0d66bc2a32bc4 Mon Sep 17 00:00:00 2001 From: Raja Subramanian Date: Thu, 28 Sep 2023 18:44:48 +0530 Subject: [PATCH] Start key frame requester on start. (#2111) Sending a single PLI on connected & bound meant that the upstream throttler may not have sent it and down stream does not have a key frame to lock onto. Caused some e2e test failures due to limited time of track. --- pkg/sfu/downtrack.go | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/pkg/sfu/downtrack.go b/pkg/sfu/downtrack.go index 0fe32361a..929386f02 100644 --- a/pkg/sfu/downtrack.go +++ b/pkg/sfu/downtrack.go @@ -1782,19 +1782,16 @@ func (d *DownTrack) GetAndResetBytesSent() (uint32, uint32) { } func (d *DownTrack) onBindAndConnectedChange() { + d.writable.Store(d.connected.Load() && d.bound.Load()) if d.connected.Load() && d.bound.Load() && !d.bindAndConnectedOnce.Swap(true) { if d.kind == webrtc.RTPCodecTypeVideo { - _, layer := d.forwarder.CheckSync() - if layer != buffer.InvalidLayerSpatial { - d.params.Receiver.SendPLI(layer, true) - } + d.maybeStartKeyFrameRequester() } if d.activePaddingOnMuteUpTrack.Load() { go d.sendPaddingOnMute() } } - d.writable.Store(d.connected.Load() && d.bound.Load()) } func (d *DownTrack) sendPaddingOnMute() {