Skip to content

Commit

Permalink
cap incorrect timestamps to 1m (#311)
Browse files Browse the repository at this point in the history
  • Loading branch information
frostbyte73 authored Sep 18, 2023
1 parent 9b59b5d commit 3a26309
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pkg/synchronizer/track.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ import (
const (
ewmaWeight = 0.9
maxDrift = time.Millisecond * 15
maxTSDelay = time.Minute
maxSNDropout = 3000 // max sequence number skip
uint32Half int64 = 2147483648
uint32Overflow int64 = 4294967296
Expand Down Expand Up @@ -186,7 +187,7 @@ func (t *TrackSynchronizer) adjust(pkt *rtp.Packet) (int64, time.Duration, bool)

// sanity check
pts := t.getElapsed(ts) + t.ptsOffset
if pts > time.Since(t.startedAt)+time.Hour {
if pts > time.Since(t.startedAt)+maxTSDelay {
// reset RTP timestamps
ts, pts = t.resetRTP(pkt)
return ts, pts, false
Expand Down

0 comments on commit 3a26309

Please sign in to comment.