Update timestamp processing for MPEG-TS

This commit is contained in:
Alexey Khit
2023-08-21 20:34:18 +03:00
parent 3db4002420
commit e0ad358aa9
5 changed files with 39 additions and 15 deletions
+7
View File
@@ -114,3 +114,10 @@ func (c *Consumer) Stop() error {
_ = c.SuperConsumer.Close()
return c.wr.Close()
}
func TimestampFromRTP(rtp *rtp.Packet, codec *core.Codec) {
if codec.ClockRate == ClockRate {
return
}
rtp.Timestamp = uint32(float64(rtp.Timestamp) / float64(codec.ClockRate) * ClockRate)
}