mirror of
https://github.com/aler9/gortsplib
synced 2025-11-01 02:52:36 +08:00
move most errors into pkg/liberrors (#408)
This commit is contained in:
@@ -1,13 +1,13 @@
|
||||
package gortsplib
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
"github.com/pion/rtcp"
|
||||
"github.com/pion/rtp"
|
||||
|
||||
"github.com/bluenviron/gortsplib/v4/pkg/format"
|
||||
"github.com/bluenviron/gortsplib/v4/pkg/liberrors"
|
||||
"github.com/bluenviron/gortsplib/v4/pkg/rtcpreceiver"
|
||||
"github.com/bluenviron/gortsplib/v4/pkg/rtplossdetector"
|
||||
"github.com/bluenviron/gortsplib/v4/pkg/rtpreorderer"
|
||||
@@ -65,14 +65,7 @@ func (sf *serverSessionFormat) stop() {
|
||||
func (sf *serverSessionFormat) readRTPUDP(pkt *rtp.Packet, now time.Time) {
|
||||
packets, lost := sf.udpReorderer.Process(pkt)
|
||||
if lost != 0 {
|
||||
sf.sm.ss.onPacketLost(fmt.Errorf("%d RTP %s lost",
|
||||
lost,
|
||||
func() string {
|
||||
if lost == 1 {
|
||||
return "packet"
|
||||
}
|
||||
return "packets"
|
||||
}()))
|
||||
sf.sm.ss.onPacketLost(liberrors.ErrServerRTPPacketsLost{Lost: lost})
|
||||
// do not return
|
||||
}
|
||||
|
||||
@@ -90,14 +83,7 @@ func (sf *serverSessionFormat) readRTPUDP(pkt *rtp.Packet, now time.Time) {
|
||||
func (sf *serverSessionFormat) readRTPTCP(pkt *rtp.Packet) {
|
||||
lost := sf.tcpLossDetector.Process(pkt)
|
||||
if lost != 0 {
|
||||
sf.sm.ss.onPacketLost(fmt.Errorf("%d RTP %s lost",
|
||||
lost,
|
||||
func() string {
|
||||
if lost == 1 {
|
||||
return "packet"
|
||||
}
|
||||
return "packets"
|
||||
}()))
|
||||
sf.sm.ss.onPacketLost(liberrors.ErrServerRTPPacketsLost{Lost: lost})
|
||||
// do not return
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user