Fix panic by CreateSenderReport before bind completed (#1397)

This commit is contained in:
cnderrauber
2023-02-08 17:02:19 +08:00
committed by GitHub
parent 4d8def2eb7
commit a04e7ce647
3 changed files with 9 additions and 9 deletions
+1 -1
View File
@@ -127,7 +127,7 @@ func (t *MediaTrackSubscriptions) AddSubscriber(sub types.LocalParticipant, wr *
// Bind callback can happen from replaceTrack, so set it up early
var reusingTransceiver atomic.Bool
var dtState sfu.DownTrackState
downTrack.OnBind(func() {
downTrack.OnBinding(func() {
wr.DetermineReceiver(downTrack.Codec())
if reusingTransceiver.Load() {
downTrack.SeedState(dtState)