Skip to content

Commit

Permalink
Include XR.SenderSSRC in its DestinationSSRC
Browse files Browse the repository at this point in the history
Include XR.SenderSSRC in its DestinationSSRC
  • Loading branch information
cnderrauber committed Mar 1, 2024
1 parent f260c33 commit a3dcc3f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
3 changes: 2 additions & 1 deletion extended_report.go
Original file line number Diff line number Diff line change
Expand Up @@ -646,7 +646,8 @@ func (x *ExtendedReport) Unmarshal(b []byte) error {

// DestinationSSRC returns an array of SSRC values that this packet refers to.
func (x *ExtendedReport) DestinationSSRC() []uint32 {
ssrc := make([]uint32, 0)
ssrc := make([]uint32, 0, len(x.Reports)+1)
ssrc = append(ssrc, x.SenderSSRC)
for _, p := range x.Reports {
ssrc = append(ssrc, p.DestinationSSRC()...)
}
Expand Down
10 changes: 10 additions & 0 deletions extended_report_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -272,4 +272,14 @@ func TestDecode(t *testing.T) {
if p.String() != pktStringer.String() {
t.Errorf("(string compare) Decoded packet does not match expected packet")
}

var includeSenderSSRC bool
for _, ssrc := range p.DestinationSSRC() {
if ssrc == p.SenderSSRC {
includeSenderSSRC = true
}
}
if !includeSenderSSRC {
t.Errorf("DestinationSSRC does not include the SenderSSRC")
}
}

0 comments on commit a3dcc3f

Please sign in to comment.