Skip to content

Commit

Permalink
Update pions/rtcp to v1.1.0
Browse files Browse the repository at this point in the history
Update module and use new compound packet API
  • Loading branch information
Sean-Der committed Mar 7, 2019
1 parent 678a09e commit 1470af3
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 11 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module github.com/pions/srtp

require (
github.com/pions/rtcp v1.0.0
github.com/pions/rtcp v1.1.0
github.com/pions/rtp v1.0.1
github.com/pkg/errors v0.8.1
github.com/stretchr/testify v1.3.0
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/pions/rtcp v1.0.0 h1:kYGe6RegZ63yVDkqXaru1+kHZAqHEufP3zfRAGKPycI=
github.com/pions/rtcp v1.0.0/go.mod h1:Q5twXlqiz775Yn37X0cl4lAsfSk8EiHgeNkte59jBY4=
github.com/pions/rtcp v1.1.0 h1:WJarRpNaGE7aScgTXARaNIObMhIbftcbiPuhhqvDtl4=
github.com/pions/rtcp v1.1.0/go.mod h1:Q5twXlqiz775Yn37X0cl4lAsfSk8EiHgeNkte59jBY4=
github.com/pions/rtp v1.0.1 h1:NJyBplPVXSkW+nL/4m8ofF1XvgNIEhoyUnlTontmOCo=
github.com/pions/rtp v1.0.1/go.mod h1:GDIt4UYlSz7za4vfaLqihGJJ+yLvgPshnqrF/lm3vcM=
github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I=
Expand Down
11 changes: 3 additions & 8 deletions session_srtcp.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,22 +102,17 @@ func (s *SessionSRTCP) decrypt(buf []byte) error {
return err
}

compoundPacket := rtcp.NewReader(bytes.NewReader(decrypted))
compoundPacket := rtcp.NewDecoder(bytes.NewReader(decrypted))
for {
_, rawrtcp, err := compoundPacket.ReadPacket()

report, err := compoundPacket.DecodePacket()
if err != nil {
if err == io.EOF {
return nil
}
return err
}

var report rtcp.Packet
report, _, err = rtcp.Unmarshal(rawrtcp)
if err != nil {
return err
}

for _, ssrc := range report.DestinationSSRC() {
r, isNew := s.session.getOrCreateReadStream(ssrc, s, newReadStreamSRTCP)
if r == nil {
Expand Down

0 comments on commit 1470af3

Please sign in to comment.