mirror of
https://github.com/aler9/gortsplib
synced 2025-10-16 20:20:40 +08:00
stop normalizing H264 PTS
This commit is contained in:
@@ -25,7 +25,6 @@ type mpegtsEncoder struct {
|
|||||||
mux *astits.Muxer
|
mux *astits.Muxer
|
||||||
dtsExtractor *h264.DTSExtractor
|
dtsExtractor *h264.DTSExtractor
|
||||||
firstIDRReceived bool
|
firstIDRReceived bool
|
||||||
startPTS time.Duration
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// newMPEGTSEncoder allocates a mpegtsEncoder.
|
// newMPEGTSEncoder allocates a mpegtsEncoder.
|
||||||
@@ -100,12 +99,9 @@ func (e *mpegtsEncoder) encode(nalus [][]byte, pts time.Duration) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
e.firstIDRReceived = true
|
e.firstIDRReceived = true
|
||||||
e.startPTS = pts
|
|
||||||
e.dtsExtractor = h264.NewDTSExtractor()
|
e.dtsExtractor = h264.NewDTSExtractor()
|
||||||
}
|
}
|
||||||
|
|
||||||
pts -= e.startPTS
|
|
||||||
|
|
||||||
dts, err := e.dtsExtractor.Extract(filteredNALUs, pts)
|
dts, err := e.dtsExtractor.Extract(filteredNALUs, pts)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
|
Reference in New Issue
Block a user