mirror of
https://github.com/aler9/gortsplib
synced 2025-10-05 15:16:51 +08:00
change rtptime.Encoder signature and initialize time to a random value (#525)
This commit is contained in:
@@ -45,7 +45,11 @@ func main() {
|
||||
}
|
||||
|
||||
// setup timestamp generator
|
||||
rtpTime := rtptime.NewEncoder(forma.ClockRate(), 0)
|
||||
rtpTime := &rtptime.Encoder{ClockRate: forma.ClockRate()}
|
||||
err = rtpTime.Initialize()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
start := time.Now()
|
||||
|
||||
// setup a ticker to sleep between frames
|
||||
@@ -89,7 +93,7 @@ func main() {
|
||||
}
|
||||
|
||||
// get current timestamp
|
||||
ts := rtpTime.Encode(time.Now().Sub(start))
|
||||
ts := rtpTime.Encode(time.Since(start))
|
||||
|
||||
// write packets to the server
|
||||
for _, pkt := range pkts {
|
||||
|
Reference in New Issue
Block a user