Skip to content

Commit

Permalink
Refine re for pcap simulator.
Browse files Browse the repository at this point in the history
  • Loading branch information
winlinvip committed Aug 9, 2023
1 parent fece1e8 commit a7cd104
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions trunk/3rdparty/srs-bench/pcap/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,12 +108,14 @@ func doMain(ctx context.Context) error {
}

if doRE {
if previousTime != nil {
if diff := ci.Timestamp.Sub(*previousTime); diff > 0 {
if previousTime == nil {
previousTime = &ci.Timestamp
} else {
if diff := ci.Timestamp.Sub(*previousTime); diff > 100*time.Millisecond {
time.Sleep(diff)
previousTime = &ci.Timestamp
}
}
previousTime = &ci.Timestamp
}

if doTrace {
Expand Down

0 comments on commit a7cd104

Please sign in to comment.