Skip to content

Commit

Permalink
Merge pull request #305 from jaesung9507/ts
Browse files Browse the repository at this point in the history
[fix] mpegts: overflow pcr
  • Loading branch information
q191201771 committed Jul 24, 2023
2 parents c492f71 + efcfc11 commit 0fbfadf
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions pkg/mpegts/pack.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down

0 comments on commit 0fbfadf

Please sign in to comment.