sdp: fix compatibility with Altasec NVRs (#476)

(https://github.com/bluenviron/mediamtx/issues/2762)
This commit is contained in:
Alessandro Ros
2023-12-08 18:45:02 +01:00
committed by GitHub
parent 3579bc548d
commit 2a578e20d8
2 changed files with 142 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 IP4") {
value += " "
}
i := strings.Index(value, " IN IP4 ")
if i < 0 {
i = strings.Index(value, " IN IP6 ")