Fix yet another broken SDP from CN cameras #1426

This commit is contained in:
Alex X
2024-11-01 12:09:44 +03:00
parent 1d1bcb0a63
commit 6b005a666e
2 changed files with 37 additions and 0 deletions
+3
View File
@@ -30,6 +30,9 @@ func UnmarshalSDP(rawSDP []byte) ([]*core.Media, error) {
// fix multiple `s=` https://github.com/AlexxIT/WebRTC/issues/417
rawSDP = regexp.MustCompile("\ns=[^\n]+").ReplaceAll(rawSDP, nil)
// fix broken `c=` https://github.com/AlexxIT/go2rtc/issues/1426
rawSDP = regexp.MustCompile("\nc=[^\n]+").ReplaceAll(rawSDP, nil)
// fix SDP header for some cameras
if i := bytes.Index(rawSDP, []byte("\nm=")); i > 0 {
rawSDP = append([]byte(sdpHeader), rawSDP[i:]...)