mirror of
https://github.com/aler9/gortsplib
synced 2025-10-05 23:26:54 +08:00
use native timestamps instead of time.Duration (#627)
this improves timestamp precision
This commit is contained in:
@@ -53,6 +53,7 @@ func main() {
|
||||
// setup MPEG-4 audio -> MPEG-TS muxer
|
||||
mpegtsMuxer := &mpegtsMuxer{
|
||||
fileName: "mystream.ts",
|
||||
format: forma,
|
||||
track: &mpegts.Track{
|
||||
Codec: &mpegts.CodecMPEG4Audio{
|
||||
Config: *forma.Config,
|
||||
@@ -74,7 +75,7 @@ func main() {
|
||||
// called when a RTP packet arrives
|
||||
c.OnPacketRTP(medi, forma, func(pkt *rtp.Packet) {
|
||||
// decode timestamp
|
||||
pts, ok := c.PacketPTS(medi, pkt)
|
||||
pts, ok := c.PacketPTS2(medi, pkt)
|
||||
if !ok {
|
||||
log.Printf("waiting for timestamp")
|
||||
return
|
||||
|
Reference in New Issue
Block a user