Skip to content

Commit

Permalink
Fix report timestamps
Browse files Browse the repository at this point in the history
This is not really a bug but annoying to receivers of our reports. If
the ticker ticks, but then another packet is handled first, the
timestamp of the report (from the ticker) will be before the receive
timestamp of the last packet in the report. In that case, the report
contains a 0x1FFF value to indicate that the packet was received after
the report. However, we know the timestamp and can send it, if we take
the timstamp after entering the case branch. At that time, it is
guaranteed, that no additional packets can be added to the report.
  • Loading branch information
mengelbart committed Jan 17, 2025
1 parent e187410 commit 4efe05c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pkg/rfc8888/interceptor.go
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,8 @@ func (s *SenderInterceptor) loop(writer interceptor.RTCPWriter) {
s.log.Tracef("got packet: %v", pkt)
s.recorder.AddPacket(pkt.arrival, pkt.ssrc, pkt.sequenceNumber, pkt.ecn)

case now := <-t.Ch():
case <-t.Ch():
now := time.Now()
s.log.Tracef("report triggered at %v", now)
if writer == nil {
s.log.Trace("no writer added, continue")
Expand Down

0 comments on commit 4efe05c

Please sign in to comment.