Browse Source

api: fix crash when retrieving RTMP and SRT connections (#2430)

Co-authored-by: Paxx <daniel.botta@hiway.media>
pull/2434/head
Paxx 3 years ago committed by GitHub
parent
commit
72e74b6456
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      internal/core/rtmp_conn.go
  2. 2
      internal/core/srt_conn.go

2
internal/core/rtmp_conn.go

@ -644,7 +644,7 @@ func (c *rtmpConn) apiItem() *apiRTMPConn { @@ -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()
}

2
internal/core/srt_conn.go

@ -697,7 +697,7 @@ func (c *srtConn) apiItem() *apiSRTConn { @@ -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

Loading…
Cancel
Save