Merge pull request #305 from jaesung9507/ts

[fix] mpegts: overflow pcr
pull/306/head
yoko 2 years ago committed by GitHub
commit 0fbfadf117
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -116,10 +116,14 @@ func (frame *Frame) Pack() []byte {
// reserved
// program_clock_reference_extension
// --------------------------------------
packet[3] |= 0x20 // adaptation_field_control 设置Adaptation
packet[4] = 7 // adaptation_field_length
packet[5] = 0x50 // random_access_indicator + PCR_flag
packPcr(packet[6:], frame.Dts-delay) // using 6 byte
packet[3] |= 0x20 // adaptation_field_control 设置Adaptation
packet[4] = 7 // adaptation_field_length
packet[5] = 0x50 // random_access_indicator + PCR_flag
pcr := uint64(0)
if frame.Dts > delay {
pcr = frame.Dts - delay
}
packPcr(packet[6:], pcr) // using 6 byte
wpos += 8
}

Loading…
Cancel
Save