From 85ce12199aa324a8399407aac41f8b2fbaad279d Mon Sep 17 00:00:00 2001 From: aler9 <46489434+aler9@users.noreply.github.com> Date: Tue, 16 Aug 2022 18:14:24 +0200 Subject: [PATCH] rtmp source: allow outgoing acknowledges --- internal/core/rtmp_conn.go | 2 +- internal/core/rtmp_source.go | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/internal/core/rtmp_conn.go b/internal/core/rtmp_conn.go index 1b565d050e9..6365c3d714b 100644 --- a/internal/core/rtmp_conn.go +++ b/internal/core/rtmp_conn.go @@ -527,7 +527,7 @@ func (c *rtmpConn) runPublish(ctx context.Context, u *url.URL) error { c.path.Name(), sourceTrackInfo(tracks)) - // disable write deadline + // disable write deadline to allow outgoing acknowledges c.nconn.SetWriteDeadline(time.Time{}) for { diff --git a/internal/core/rtmp_source.go b/internal/core/rtmp_source.go index 2f809d0abd5..7bdcde628e5 100644 --- a/internal/core/rtmp_source.go +++ b/internal/core/rtmp_source.go @@ -148,6 +148,9 @@ func (s *rtmpSource) run(ctx context.Context) error { s.parent.sourceStaticImplSetNotReady(pathSourceStaticSetNotReadyReq{}) }() + // disable write deadline to allow outgoing acknowledges + nconn.SetWriteDeadline(time.Time{}) + for { nconn.SetReadDeadline(time.Now().Add(time.Duration(s.readTimeout))) msg, err := conn.ReadMessage()