Fix log marshal error (#2295)
This commit is contained in:
@@ -352,7 +352,7 @@ func (b *Buffer) Close() error {
|
|||||||
b.rtpStats.Stop()
|
b.rtpStats.Stop()
|
||||||
b.logger.Debugw("rtp stats",
|
b.logger.Debugw("rtp stats",
|
||||||
"direction", "upstream",
|
"direction", "upstream",
|
||||||
"stats", func() interface{} { return b.rtpStats.ToString() },
|
"stats", b.rtpStats,
|
||||||
)
|
)
|
||||||
if b.onFinalRtpStats != nil {
|
if b.onFinalRtpStats != nil {
|
||||||
b.onFinalRtpStats(b.rtpStats.ToProto())
|
b.onFinalRtpStats(b.rtpStats.ToProto())
|
||||||
|
|||||||
@@ -402,7 +402,7 @@ func (r *RTPStatsReceiver) DeltaInfo(snapshotID uint32) *RTPDeltaInfo {
|
|||||||
return r.deltaInfo(snapshotID, r.sequenceNumber.GetExtendedStart(), r.sequenceNumber.GetExtendedHighest())
|
return r.deltaInfo(snapshotID, r.sequenceNumber.GetExtendedStart(), r.sequenceNumber.GetExtendedHighest())
|
||||||
}
|
}
|
||||||
|
|
||||||
func (r *RTPStatsReceiver) ToString() string {
|
func (r *RTPStatsReceiver) String() string {
|
||||||
r.lock.RLock()
|
r.lock.RLock()
|
||||||
defer r.lock.RUnlock()
|
defer r.lock.RUnlock()
|
||||||
|
|
||||||
|
|||||||
@@ -20,9 +20,10 @@ import (
|
|||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/livekit/protocol/logger"
|
|
||||||
"github.com/pion/rtp"
|
"github.com/pion/rtp"
|
||||||
"github.com/stretchr/testify/require"
|
"github.com/stretchr/testify/require"
|
||||||
|
|
||||||
|
"github.com/livekit/protocol/logger"
|
||||||
)
|
)
|
||||||
|
|
||||||
func getPacket(sn uint16, ts uint32, payloadSize int) *rtp.Packet {
|
func getPacket(sn uint16, ts uint32, payloadSize int) *rtp.Packet {
|
||||||
@@ -82,7 +83,7 @@ func Test_RTPStatsReceiver(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
r.Stop()
|
r.Stop()
|
||||||
fmt.Printf("%s\n", r.ToString())
|
fmt.Printf("%s\n", r.String())
|
||||||
}
|
}
|
||||||
|
|
||||||
func Test_RTPStatsReceiver_Update(t *testing.T) {
|
func Test_RTPStatsReceiver_Update(t *testing.T) {
|
||||||
|
|||||||
@@ -989,9 +989,8 @@ func (d *DownTrack) CloseWithFlush(flush bool) {
|
|||||||
"mime", d.mime,
|
"mime", d.mime,
|
||||||
"ssrc", d.ssrc,
|
"ssrc", d.ssrc,
|
||||||
// evaluate only if log level matches
|
// evaluate only if log level matches
|
||||||
"stats", func() interface{} {
|
"stats", d.rtpStats,
|
||||||
return d.rtpStats.ToString()
|
)
|
||||||
})
|
|
||||||
|
|
||||||
d.maxLayerNotifierChMu.Lock()
|
d.maxLayerNotifierChMu.Lock()
|
||||||
d.maxLayerNotifierChClosed = true
|
d.maxLayerNotifierChClosed = true
|
||||||
|
|||||||
Reference in New Issue
Block a user