mirror of
https://github.com/aler9/gortsplib
synced 2025-10-16 04:00:46 +08:00
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:
@@ -251,7 +251,8 @@ func (sc *ServerConn) readFuncTCP(readRequest chan readReq) error {
|
||||
|
||||
packets, err := rtcp.Unmarshal(payload)
|
||||
if err != nil {
|
||||
return err
|
||||
onDecodeError(sc.session, err)
|
||||
return nil
|
||||
}
|
||||
|
||||
if h, ok := sc.s.Handler.(ServerHandlerOnPacketRTCP); ok {
|
||||
@@ -294,7 +295,8 @@ func (sc *ServerConn) readFuncTCP(readRequest chan readReq) error {
|
||||
|
||||
packets, err := rtcp.Unmarshal(payload)
|
||||
if err != nil {
|
||||
return err
|
||||
onDecodeError(sc.session, err)
|
||||
return nil
|
||||
}
|
||||
|
||||
for _, pkt := range packets {
|
||||
|
Reference in New Issue
Block a user