mirror of
https://github.com/aler9/gortsplib
synced 2025-10-05 15:16:51 +08:00
log decode errors and lost packets by default (#380)
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
/*
|
||||
Package gortsplib is a RTSP 1.0 library for the Go programming language,
|
||||
written for rtsp-simple-server.
|
||||
Package gortsplib is a RTSP 1.0 library for the Go programming language.
|
||||
|
||||
Examples are available at https://github.com/bluenviron/gortsplib/tree/main/examples
|
||||
*/
|
||||
@@ -10,6 +9,7 @@ import (
|
||||
"context"
|
||||
"crypto/tls"
|
||||
"fmt"
|
||||
"log"
|
||||
"net"
|
||||
"strconv"
|
||||
"strings"
|
||||
@@ -390,6 +390,7 @@ func (c *Client) Start(scheme string, host string) error {
|
||||
}
|
||||
if c.OnTransportSwitch == nil {
|
||||
c.OnTransportSwitch = func(err error) {
|
||||
log.Println(err.Error())
|
||||
}
|
||||
}
|
||||
if c.Log != nil && c.OnPacketLost == nil {
|
||||
@@ -399,6 +400,7 @@ func (c *Client) Start(scheme string, host string) error {
|
||||
}
|
||||
if c.OnPacketLost == nil {
|
||||
c.OnPacketLost = func(err error) {
|
||||
log.Println(err.Error())
|
||||
}
|
||||
}
|
||||
if c.Log != nil && c.OnDecodeError == nil {
|
||||
@@ -408,6 +410,7 @@ func (c *Client) Start(scheme string, host string) error {
|
||||
}
|
||||
if c.OnDecodeError == nil {
|
||||
c.OnDecodeError = func(err error) {
|
||||
log.Println(err.Error())
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -3,6 +3,7 @@ package gortsplib
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"log"
|
||||
"net"
|
||||
"strconv"
|
||||
"strings"
|
||||
@@ -256,6 +257,8 @@ func (ss *ServerSession) onPacketLost(err error) {
|
||||
Session: ss,
|
||||
Error: err,
|
||||
})
|
||||
} else {
|
||||
log.Println(err.Error())
|
||||
}
|
||||
}
|
||||
|
||||
@@ -270,6 +273,8 @@ func (ss *ServerSession) onDecodeError(err error) {
|
||||
Session: ss,
|
||||
Error: err,
|
||||
})
|
||||
} else {
|
||||
log.Println(err.Error())
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user