From de33d35166ce9d78c7353570dad19d387c3e75ff Mon Sep 17 00:00:00 2001 From: David Colburn Date: Mon, 15 Jan 2024 18:56:39 -0800 Subject: [PATCH 1/2] remove packet loss logging --- pkg/jitter/buffer.go | 30 ------------------------------ 1 file changed, 30 deletions(-) diff --git a/pkg/jitter/buffer.go b/pkg/jitter/buffer.go index a95f5f01..3d1ecd2b 100644 --- a/pkg/jitter/buffer.go +++ b/pkg/jitter/buffer.go @@ -111,12 +111,6 @@ func (b *Buffer) Push(pkt *rtp.Packet) { // drop if packet comes before previously pushed packet if !p.padding { b.packetsDropped++ - b.logger.Debugw("packet dropped", - "sequence number", pkt.SequenceNumber, - "timestamp", pkt.Timestamp, - "reason", "too late", - "minimum sequence number", b.prevSN+1, - ) if b.onPacketDropped != nil { b.onPacketDropped() } @@ -404,30 +398,14 @@ func (b *Buffer) drop() { // on sequence number reset, skip callback because we don't know whether we lost any if !b.head.reset { b.packetsDropped++ - b.logger.Debugw("packet dropped", - "sequence number", formatSN(b.prevSN+1, b.head.packet.SequenceNumber-1), - "reason", "lost", - ) dropped = true } - count := 0 - from := b.head.packet.SequenceNumber - ts := b.head.packet.Timestamp for b.head != nil && !b.head.start && before32(b.head.packet.Timestamp-b.maxSampleSize, b.minTS) { dropped = true - count++ b.packetsDropped++ b.dropHead() } - if count > 0 { - b.logger.Debugw("packet dropped", - "sequence number", formatSN(from, b.head.packet.SequenceNumber-1), - "timestamp", ts, - "reason", "incomplete sample", - "minimum timestamp", b.minTS, - ) - } b.prevSN = b.head.packet.SequenceNumber - 1 } @@ -441,7 +419,6 @@ func (b *Buffer) drop() { // drop all packets within this sample dropped = true count := 0 - from := c.packet.SequenceNumber ts := c.packet.Timestamp for { b.packetsDropped++ @@ -454,13 +431,6 @@ func (b *Buffer) drop() { break } } - - b.logger.Debugw("packet dropped", - "sequence number", formatSN(from, b.head.packet.SequenceNumber-1), - "timestamp", ts, - "reason", "incomplete sample", - "minimum timestamp", b.minTS, - ) } if dropped && b.onPacketDropped != nil { From ecac9927ff895f7af8f1c2651ba0306c475ab33e Mon Sep 17 00:00:00 2001 From: David Colburn Date: Mon, 15 Jan 2024 19:08:15 -0800 Subject: [PATCH 2/2] unused function --- pkg/jitter/buffer.go | 9 --------- 1 file changed, 9 deletions(-) diff --git a/pkg/jitter/buffer.go b/pkg/jitter/buffer.go index 3d1ecd2b..bf4aafaf 100644 --- a/pkg/jitter/buffer.go +++ b/pkg/jitter/buffer.go @@ -15,7 +15,6 @@ package jitter import ( - "fmt" "sync" "time" @@ -495,11 +494,3 @@ func before32(a, b uint32) bool { func outsideRange(a, b uint16) bool { return a-b > 3000 && b-a > 3000 } - -func formatSN(from, to uint16) string { - if from == to { - return fmt.Sprint(from) - } else { - return fmt.Sprintf("%d-%d", from, to) - } -}