Fix parsing SDP from Reolink Doorbell

This commit is contained in:
Alexey Khit
2023-02-07 20:02:23 +03:00
parent b05cbdf3d3
commit 9ed4d4cedb
2 changed files with 41 additions and 2 deletions
+6
View File
@@ -23,6 +23,12 @@ s=-
t=0 0`
func UnmarshalSDP(rawSDP []byte) ([]*streamer.Media, error) {
// fix bug from Reolink Doorbell
if i := bytes.Index(rawSDP, []byte("a=sendonlym=")); i > 0 {
rawSDP = append(rawSDP[:i+11], rawSDP[i+10:]...)
rawSDP[i+10] = '\n'
}
sd := &sdp.SessionDescription{}
if err := sd.Unmarshal(rawSDP); err != nil {
// fix multiple `s=` https://github.com/AlexxIT/WebRTC/issues/417