diff --git a/internal/core/rtmp_conn.go b/internal/core/rtmp_conn.go index b263d4e9..f7dca5bf 100644 --- a/internal/core/rtmp_conn.go +++ b/internal/core/rtmp_conn.go @@ -644,7 +644,7 @@ func (c *rtmpConn) apiItem() *apiRTMPConn { bytesReceived := uint64(0) bytesSent := uint64(0) - if c.conn != nil { + if c.rconn != nil { bytesReceived = c.rconn.BytesReceived() bytesSent = c.rconn.BytesSent() } diff --git a/internal/core/srt_conn.go b/internal/core/srt_conn.go index 96bcc6b4..860c994d 100644 --- a/internal/core/srt_conn.go +++ b/internal/core/srt_conn.go @@ -697,7 +697,7 @@ func (c *srtConn) apiItem() *apiSRTConn { bytesReceived := uint64(0) bytesSent := uint64(0) - if c.conn != nil { + if c.sconn != nil { var s srt.Statistics c.sconn.Stats(&s) bytesReceived = s.Accumulated.ByteRecv