diff --git a/go.mod b/go.mod index 15139bcd..c1e1be51 100644 --- a/go.mod +++ b/go.mod @@ -10,7 +10,7 @@ require ( github.com/atrox/haikunatorgo/v2 v2.0.1 github.com/caddyserver/certmagic v0.21.2 github.com/datarhei/gosrt v0.6.0 - github.com/datarhei/joy4 v0.0.0-20240529125512-3aeb406414d6 + github.com/datarhei/joy4 v0.0.0-20240529142948-6b449f526167 github.com/go-playground/validator/v10 v10.20.0 github.com/gobwas/glob v0.2.3 github.com/golang-jwt/jwt/v5 v5.2.1 diff --git a/go.sum b/go.sum index 8f5528f8..c3fe1f3d 100644 --- a/go.sum +++ b/go.sum @@ -30,8 +30,8 @@ github.com/cpuguy83/go-md2man/v2 v2.0.4 h1:wfIWP927BUkWJb2NmU/kNDYIBTh/ziUX91+lV github.com/cpuguy83/go-md2man/v2 v2.0.4/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= github.com/datarhei/gosrt v0.6.0 h1:HrrXAw90V78ok4WMIhX6se1aTHPCn82Sg2hj+PhdmGc= github.com/datarhei/gosrt v0.6.0/go.mod h1:fsOWdLSHUHShHjgi/46h6wjtdQrtnSdAQFnlas8ONxs= -github.com/datarhei/joy4 v0.0.0-20240529125512-3aeb406414d6 h1:qrAUWrwNUUj8Desdima+jg4xwymQ2b7khI0fm+e4BAw= -github.com/datarhei/joy4 v0.0.0-20240529125512-3aeb406414d6/go.mod h1:Jcw/6jZDQQmPx8A7INEkXmuEF7E9jjBbSTfVSLwmiQw= +github.com/datarhei/joy4 v0.0.0-20240529142948-6b449f526167 h1:hkMdYcoj4H0TQ2rSfN5uU164+Qm27P2qN04D37ISKo0= +github.com/datarhei/joy4 v0.0.0-20240529142948-6b449f526167/go.mod h1:Jcw/6jZDQQmPx8A7INEkXmuEF7E9jjBbSTfVSLwmiQw= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= diff --git a/rtmp/rtmp.go b/rtmp/rtmp.go index 166042e4..bdd24b5f 100644 --- a/rtmp/rtmp.go +++ b/rtmp/rtmp.go @@ -4,7 +4,9 @@ package rtmp import ( "context" "crypto/tls" + "errors" "fmt" + "io" "net" "net/url" "path/filepath" @@ -435,7 +437,9 @@ func (s *server) handlePlay(conn *rtmp.Conn) { // Transfer the data err := avutil.CopyFile(conn, demuxer) if err != nil { - s.log(log.Lerror, "PLAY", "ERROR", playPath, err.Error(), client) + if !errors.Is(err, io.EOF) { + s.log(log.Lerror, "PLAY", "ERROR", playPath, err.Error(), client) + } } ch.RemoveSubscriber(id) @@ -528,7 +532,9 @@ func (s *server) handlePublish(conn *rtmp.Conn) { // Ingest the data err := avutil.CopyPackets(ch.queue, conn) if err != nil { - s.log(log.Lerror, "PUBLISH", "ERROR", playPath, err.Error(), client) + if !errors.Is(err, io.EOF) { + s.log(log.Lerror, "PUBLISH", "ERROR", playPath, err.Error(), client) + } } s.lock.Lock() diff --git a/vendor/github.com/datarhei/joy4/format/rtmp/rtmp.go b/vendor/github.com/datarhei/joy4/format/rtmp/rtmp.go index 7d7c4598..ea1454ac 100644 --- a/vendor/github.com/datarhei/joy4/format/rtmp/rtmp.go +++ b/vendor/github.com/datarhei/joy4/format/rtmp/rtmp.go @@ -212,9 +212,9 @@ func (s *Server) Close() { if s.listener != nil { s.listener.Close() s.listener = nil - } - close(s.doneChan) + close(s.doneChan) + } } const ( diff --git a/vendor/modules.txt b/vendor/modules.txt index 0c087bd3..15228159 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -64,7 +64,7 @@ github.com/datarhei/gosrt/crypto github.com/datarhei/gosrt/net github.com/datarhei/gosrt/packet github.com/datarhei/gosrt/rand -# github.com/datarhei/joy4 v0.0.0-20240529125512-3aeb406414d6 +# github.com/datarhei/joy4 v0.0.0-20240529142948-6b449f526167 ## explicit; go 1.14 github.com/datarhei/joy4/av github.com/datarhei/joy4/av/avutil