use native timestamps instead of time.Duration (#627)

this improves timestamp precision
This commit is contained in:
Alessandro Ros
2024-10-07 15:58:43 +02:00
committed by GitHub
parent 5ec470c827
commit 2ca0bffa20
33 changed files with 220 additions and 109 deletions

View File

@@ -46,7 +46,7 @@ func main() {
// called when a RTP packet arrives
c.OnPacketRTPAny(func(medi *description.Media, forma format.Format, pkt *rtp.Packet) {
// get the PTS timestamp of the packet, i.e. timestamp relative to the start of the session
pts, ptsAvailable := c.PacketPTS(medi, pkt)
pts, ptsAvailable := c.PacketPTS2(medi, pkt)
log.Printf("PTS: available=%v, value=%v\n", ptsAvailable, pts)
// get the NTP timestamp of the packet, i.e. the absolute timestamp