Skip to content

Commit

Permalink
fix(sfu): write correct ssrc for buffered packets
Browse files Browse the repository at this point in the history
  • Loading branch information
OrlandoCo committed Dec 9, 2020
1 parent c58b6b7 commit 162e788
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pkg/buffer/interceptor.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ func (i *Interceptor) BindRTCPWriter(writer interceptor.RTCPWriter) interceptor.
return writer
}

func (i *Interceptor) GetBufferedPackets(ssrc uint32, snOffset uint16, tsOffset uint32, sn []uint16) []rtp.Packet {
func (i *Interceptor) GetBufferedPackets(ssrc, mediaSSRC uint32, snOffset uint16, tsOffset uint32, sn []uint16) []rtp.Packet {
buffer := i.getBuffer(ssrc)
if buffer == nil {
return nil
Expand All @@ -101,6 +101,7 @@ func (i *Interceptor) GetBufferedPackets(ssrc uint32, snOffset uint16, tsOffset
if err != nil {
continue
}
h.SSRC = mediaSSRC
h.SequenceNumber -= snOffset
h.Timestamp -= tsOffset
pkts = append(pkts, rtp.Packet{
Expand Down
1 change: 1 addition & 0 deletions pkg/sfu/router.go
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,7 @@ func (r *router) loopDownTrackRTCP(track *DownTrack) {
for _, pair := range p.Nacks {
for _, pt := range r.buffer.GetBufferedPackets(
track.receiver.SSRC(track.currentSpatialLayer),
track.ssrc,
track.snOffset,
track.tsOffset,
track.nList.getNACKSeqNo(pair.PacketList())) {
Expand Down

0 comments on commit 162e788

Please sign in to comment.