estimate absolute timestamp more precisely (#5078)

When the absolute timestamp of incoming frames was not available, it
was filled with the current timestamp, which is influenced by latency
over time.

This mechanism is replaced by an algorithm that detects when latency is
the lowest, stores the current timestamp and uses it as reference
throughout the rest of the stream.
This commit is contained in:
Alessandro Ros 2025-10-12 11:02:14 +02:00 committed by GitHub
parent f5f03562d3
commit 0cdae40fe3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
30 changed files with 296 additions and 178 deletions

View file

@ -567,7 +567,7 @@ func TestServerRead(t *testing.T) {
done := make(chan struct{})
wc.IncomingTracks()[0].OnPacketRTP = func(pkt *rtp.Packet, _ time.Time) {
wc.IncomingTracks()[0].OnPacketRTP = func(pkt *rtp.Packet) {
select {
case <-done:
default: