forked from External/mediamtx
produce same absolute time in RTSP and HLS (#1249)
* add a NTP timestamp to each data unit * use that NTP timestamp in all protocols
This commit is contained in:
parent
7a49b92d9b
commit
e605727c78
15 changed files with 69 additions and 35 deletions
|
|
@ -151,18 +151,21 @@ func (s *rtspSource) run(ctx context.Context) error {
|
|||
err = res.stream.writeData(&dataH264{
|
||||
trackID: ctx.TrackID,
|
||||
rtpPackets: []*rtp.Packet{ctx.Packet},
|
||||
ntp: time.Now(),
|
||||
})
|
||||
|
||||
case *gortsplib.TrackMPEG4Audio:
|
||||
err = res.stream.writeData(&dataMPEG4Audio{
|
||||
trackID: ctx.TrackID,
|
||||
rtpPackets: []*rtp.Packet{ctx.Packet},
|
||||
ntp: time.Now(),
|
||||
})
|
||||
|
||||
default:
|
||||
err = res.stream.writeData(&dataGeneric{
|
||||
trackID: ctx.TrackID,
|
||||
rtpPackets: []*rtp.Packet{ctx.Packet},
|
||||
ntp: time.Now(),
|
||||
})
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue