Browse Source

run runOnRead command also with RTMP readers

pull/639/head
aler9 4 years ago
parent
commit
c46ae16dc7
  1. 9
      internal/core/rtmp_conn.go

9
internal/core/rtmp_conn.go

@ -277,6 +277,15 @@ func (c *rtmpConn) runRead(ctx context.Context) error { @@ -277,6 +277,15 @@ func (c *rtmpConn) runRead(ctx context.Context) error {
Author: c,
})
if c.path.Conf().RunOnRead != "" {
_, port, _ := net.SplitHostPort(c.rtspAddress)
onReadCmd := externalcmd.New(c.path.Conf().RunOnRead, c.path.Conf().RunOnReadRestart, externalcmd.Environment{
Path: c.path.Name(),
Port: port,
})
defer onReadCmd.Close()
}
// disable read deadline
c.conn.NetConn().SetReadDeadline(time.Time{})

Loading…
Cancel
Save