Skip to content

Commit

Permalink
Merge pull request #15 from zhngs/dev_zs
Browse files Browse the repository at this point in the history
audio rtx
  • Loading branch information
notedit authored Apr 7, 2023
2 parents de96661 + 4e615d1 commit 13b1be0
Showing 1 changed file with 22 additions and 5 deletions.
27 changes: 22 additions & 5 deletions sdpinfo.go
Original file line number Diff line number Diff line change
Expand Up @@ -428,11 +428,28 @@ func (s *SDPInfo) String() string {
}

if codec.HasRTX() {
mediaMap.Rtp = append(mediaMap.Rtp, &transform.RtpStruct{
Payload: codec.GetRTX(),
Codec: "rtx",
Rate: 90000,
})
if "video" == strings.ToLower(media.GetType()) {
mediaMap.Rtp = append(mediaMap.Rtp, &transform.RtpStruct{
Payload: codec.GetRTX(),
Codec: "rtx",
Rate: 90000,
})
} else {
if "opus" == strings.ToLower(codec.GetCodec()) {
mediaMap.Rtp = append(mediaMap.Rtp, &transform.RtpStruct{
Payload: codec.GetRTX(),
Codec: "rtx",
Rate: codec.GetRate(),
Encoding: 2,
})
} else {
mediaMap.Rtp = append(mediaMap.Rtp, &transform.RtpStruct{
Payload: codec.GetRTX(),
Codec: "rtx",
Rate: codec.GetRate(),
})
}
}
mediaMap.Fmtp = append(mediaMap.Fmtp, &transform.FmtpStruct{
Payload: codec.GetRTX(),
Config: "apt=" + strconv.Itoa(codec.GetPayload()),
Expand Down

0 comments on commit 13b1be0

Please sign in to comment.