allow invalid RTCP packets in both client and server

(https://github.com/aler9/rtsp-simple-server/issues/1085)

Invalid RTCP packets, in both server and client, do not trigger a fatal
error anymore but they're just blocked. OnDecodeError() is called in
order to emit a warning.
This commit is contained in:
aler9
2022-12-09 12:45:51 +01:00
parent 00efb912aa
commit 99855bd3a2
5 changed files with 40 additions and 6 deletions

View File

@@ -825,8 +825,6 @@ func (c *Client) runReader() {
packets, err := rtcp.Unmarshal(payload)
if err != nil {
// some cameras send invalid RTCP packets.
// ignore them.
c.OnDecodeError(err)
return nil
}
@@ -852,7 +850,8 @@ func (c *Client) runReader() {
packets, err := rtcp.Unmarshal(payload)
if err != nil {
return err
c.OnDecodeError(err)
return nil
}
for _, pkt := range packets {