align PacketPTS() and PacketNTP(); add example (#374)

This commit is contained in:
Alessandro Ros
2023-08-22 20:53:23 +02:00
committed by GitHub
parent cab426e350
commit 29ddbbbbf5
23 changed files with 155 additions and 66 deletions

View File

@@ -116,7 +116,8 @@ func (sh *serverHandler) OnRecord(ctx *gortsplib.ServerHandlerOnRecordCtx) (*bas
// called when receiving a RTP packet
ctx.Session.OnPacketRTP(sh.media, sh.format, func(pkt *rtp.Packet) {
pts, ok := ctx.Session.PacketPTS(sh.format, pkt)
// decode timestamp
pts, ok := ctx.Session.PacketPTS(sh.media, pkt)
if !ok {
return
}