mirror of
https://github.com/livekit/livekit.git
synced 2026-08-24 13:59:45 +00:00
handle when RTCP comes in after track is closed
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
package rtc
|
||||
|
||||
import (
|
||||
"context"
|
||||
"io"
|
||||
"sync"
|
||||
"time"
|
||||
@@ -31,7 +30,6 @@ var (
|
||||
// MediaTrack represents a WebRTC track that needs to be forwarded
|
||||
// Implements the PublishedTrack interface
|
||||
type MediaTrack struct {
|
||||
ctx context.Context
|
||||
id string
|
||||
participantId string
|
||||
muted bool
|
||||
@@ -57,7 +55,6 @@ type MediaTrack struct {
|
||||
|
||||
func NewMediaTrack(trackId string, pId string, rtcpCh chan []rtcp.Packet, track *webrtc.TrackRemote, receiver types.Receiver) *MediaTrack {
|
||||
t := &MediaTrack{
|
||||
ctx: context.Background(),
|
||||
id: trackId,
|
||||
participantId: pId,
|
||||
ssrc: track.SSRC(),
|
||||
@@ -332,6 +329,10 @@ func (t *MediaTrack) handleRTCP(dt *sfu.DownTrack, rtcpBuf []byte) {
|
||||
for _, pair := range p.Nacks {
|
||||
nackedPackets = append(nackedPackets, dt.GetNACKSeqNo(pair.PacketList())...)
|
||||
}
|
||||
|
||||
if t.nackWorker.Stopped() {
|
||||
return
|
||||
}
|
||||
t.nackWorker.Submit(func() {
|
||||
pktBuf := packetFactory.Get().([]byte)
|
||||
for _, sn := range nackedPackets {
|
||||
|
||||
Reference in New Issue
Block a user