Browse Source

rtmp source: allow outgoing acknowledges

pull/1128/head v0.20.0
aler9 3 years ago
parent
commit
85ce12199a
  1. 2
      internal/core/rtmp_conn.go
  2. 3
      internal/core/rtmp_source.go

2
internal/core/rtmp_conn.go

@ -527,7 +527,7 @@ func (c *rtmpConn) runPublish(ctx context.Context, u *url.URL) error { @@ -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 {

3
internal/core/rtmp_source.go

@ -148,6 +148,9 @@ func (s *rtmpSource) run(ctx context.Context) error { @@ -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()

Loading…
Cancel
Save