Skip to content

Commit

Permalink
remove packet loss logging (#377)
Browse files Browse the repository at this point in the history
* remove packet loss logging

* unused function
  • Loading branch information
frostbyte73 authored Jan 16, 2024
1 parent ddded83 commit 167f58a
Showing 1 changed file with 0 additions and 39 deletions.
39 changes: 0 additions & 39 deletions pkg/jitter/buffer.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
package jitter

import (
"fmt"
"sync"
"time"

Expand Down Expand Up @@ -111,12 +110,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()
}
Expand Down Expand Up @@ -404,30 +397,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
}
Expand All @@ -441,7 +418,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++
Expand All @@ -454,13 +430,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 {
Expand Down Expand Up @@ -525,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)
}
}

0 comments on commit 167f58a

Please sign in to comment.