mirror of
https://github.com/bluenviron/mediamtx
synced 2025-01-18 21:10:54 +00:00
rtsp server: log decode errors
This commit is contained in:
parent
584cc9357a
commit
f7fdd60966
@ -389,7 +389,7 @@ func (s *rtspServer) OnPause(ctx *gortsplib.ServerHandlerOnPauseCtx) (*base.Resp
|
||||
return se.onPause(ctx)
|
||||
}
|
||||
|
||||
// OnPacketRTP implements gortsplib.ServerHandlerOnPacket.
|
||||
// OnPacketRTP implements gortsplib.ServerHandlerOnPacketRTP.
|
||||
func (s *rtspServer) OnPacketRTP(ctx *gortsplib.ServerHandlerOnPacketRTPCtx) {
|
||||
s.mutex.RLock()
|
||||
se := s.sessions[ctx.Session]
|
||||
@ -397,6 +397,14 @@ func (s *rtspServer) OnPacketRTP(ctx *gortsplib.ServerHandlerOnPacketRTPCtx) {
|
||||
se.onPacketRTP(ctx)
|
||||
}
|
||||
|
||||
// OnDecodeError implements gortsplib.ServerHandlerOnOnDecodeError.
|
||||
func (s *rtspServer) OnDecodeError(ctx *gortsplib.ServerHandlerOnDecodeErrorCtx) {
|
||||
s.mutex.RLock()
|
||||
se := s.sessions[ctx.Session]
|
||||
s.mutex.RUnlock()
|
||||
se.onDecodeError(ctx)
|
||||
}
|
||||
|
||||
// apiSessionsList is called by api and metrics.
|
||||
func (s *rtspServer) apiSessionsList(req rtspServerAPISessionsListReq) rtspServerAPISessionsListRes {
|
||||
select {
|
||||
|
@ -394,3 +394,8 @@ func (s *rtspSession) onPacketRTP(ctx *gortsplib.ServerHandlerOnPacketRTPCtx) {
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
// onDecodeError is called by rtspServer.
|
||||
func (s *rtspSession) onDecodeError(ctx *gortsplib.ServerHandlerOnDecodeErrorCtx) {
|
||||
s.log(logger.Warn, "%v", ctx.Error)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user