support non-canonical headers, empty sdp origins, non-standard sdp protocols, rtp packets up to 512k; fix #8

This commit is contained in:
aler9 2020-05-17 16:37:33 +02:00
parent da664ab387
commit a532430396
3 changed files with 8 additions and 5 deletions

2
go.mod
View File

@ -5,7 +5,7 @@ go 1.13
require (
github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751 // indirect
github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d // indirect
github.com/aler9/gortsplib v0.0.0-20200507200122-6f72517d1732
github.com/aler9/gortsplib v0.0.0-20200517142010-db3770c8f3a0
github.com/stretchr/testify v1.4.0
gopkg.in/alecthomas/kingpin.v2 v2.2.6
gortc.io/sdp v0.17.0

4
go.sum
View File

@ -2,8 +2,8 @@ github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751 h1:JYp7IbQjafo
github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc=
github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d h1:UQZhZ2O0vMHr2cI+DC1Mbh0TJxzA3RcLoMsFw+aXw7E=
github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho=
github.com/aler9/gortsplib v0.0.0-20200507200122-6f72517d1732 h1:7LVcFWXTKYEqtPF4333zfPrxpQ1W4KVuY7RpwBETefg=
github.com/aler9/gortsplib v0.0.0-20200507200122-6f72517d1732/go.mod h1:YiIgmmv0ELkWUy11Jj2h5AgfqLCpy8sIX/l9MmS8+uw=
github.com/aler9/gortsplib v0.0.0-20200517142010-db3770c8f3a0 h1:/v4nyRb/wrhEkx+oKL4iDelWzYVJfcX4oa2MG0Yo9pc=
github.com/aler9/gortsplib v0.0.0-20200517142010-db3770c8f3a0/go.mod h1:YiIgmmv0ELkWUy11Jj2h5AgfqLCpy8sIX/l9MmS8+uw=
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/pkg/errors v0.8.0 h1:WdK/asTD0HN+q6hsWO3/vpuAkAr+tw6aNJNDFFf0+qw=

View File

@ -24,7 +24,10 @@ func sdpParse(in []byte) (*sdp.Message, error) {
d := sdp.NewDecoder(s)
err = d.Decode(m)
if err != nil {
return nil, err
// allow empty Origins
if err.Error() != "failed to decode message: DecodeError in section s: origin address not set" {
return nil, err
}
}
if len(m.Medias) == 0 {
@ -65,7 +68,7 @@ func sdpFilter(msgIn *sdp.Message, byteIn []byte) (*sdp.Message, []byte) {
Bandwidths: m.Bandwidths,
Description: sdp.MediaDescription{
Type: m.Description.Type,
Protocol: m.Description.Protocol,
Protocol: "RTP/AVP", // override protocol
Formats: m.Description.Formats,
},
Attributes: attributes,