Skip to content

Commit 7c97e8e

Browse files
authored
Fix report timestamps (#305)
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.
1 parent 73f7ccf commit 7c97e8e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

pkg/rfc8888/interceptor.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,8 @@ func (s *SenderInterceptor) loop(writer interceptor.RTCPWriter) {
169169
s.log.Tracef("got packet: %v", pkt)
170170
s.recorder.AddPacket(pkt.arrival, pkt.ssrc, pkt.sequenceNumber, pkt.ecn)
171171

172-
case now := <-t.Ch():
172+
case <-t.Ch():
173+
now := s.now()
173174
s.log.Tracef("report triggered at %v", now)
174175
if writer == nil {
175176
s.log.Trace("no writer added, continue")

0 commit comments

Comments
 (0)