Fix crash when audio nack packets received
If client sent rtcp.TransportLayerNack to audio downtrack,
ion-sfu going crash because downTrack.sequencer is only allocated for video track.
Check sequencer is nil when rtcp.TransportLayerNack has arrived.
@@ -535,6 +535,7 @@ func (d *DownTrack) handleRTCP(bytes []byte) {
}
}
case *rtcp.TransportLayerNack:
+ if d.sequencer != nil {
var nackedPackets []packetMeta
for _, pair := range p.Nacks {
nackedPackets = append(nackedPackets, d.sequencer.getSeqNoPairs(pair.PacketList())...)
@@ -544,6 +545,7 @@ func (d *DownTrack) handleRTCP(bytes []byte) {
}
}
}
+ }
if d.trackType == SimulcastDownTrack && (maxRatePacketLoss != 0 || expectedMinBitrate != 0) {
d.handleLayerChange(maxRatePacketLoss, expectedMinBitrate)
}
