fix SDP compatibility with some Uniview cameras (#618) (#765)

This commit is contained in:
Alessandro Ros
2025-04-26 16:13:37 +02:00
committed by GitHub
parent e434427da8
commit 900f4958ca
2 changed files with 105 additions and 0 deletions

View File

@@ -89,6 +89,10 @@ func stringsReverseIndexByte(s string, b byte) int {
func (s *SessionDescription) unmarshalOrigin(value string) error {
value = strings.Replace(value, " IN IPV4 ", " IN IP4 ", 1)
if strings.HasSuffix(value, " IN") {
value += " IP4"
}
if strings.HasSuffix(value, "IN IP4") {
value += " "
}
@@ -187,6 +191,10 @@ func (s *SessionDescription) unmarshalPhone(value string) error {
}
func unmarshalConnectionInformation(value string) (*psdp.ConnectionInformation, error) {
if value == "IN" {
return nil, nil
}
value = strings.Replace(value, "IN IPV4 ", "IN IP4 ", 1)
if strings.HasPrefix(value, "IN c=IN") {