fix: rtp relay

This commit is contained in:
langhuihui
2023-11-03 14:10:48 +08:00
parent f8937ea148
commit 25e15d0492
3 changed files with 4 additions and 2 deletions

View File

@@ -263,7 +263,7 @@ func (s *Subscriber) PlayBlock(subType byte) {
}
sendAudioFrame = func(frame *AVFrame) {
// fmt.Println("a", frame.Sequence, frame.AbsTime, s.AudioReader.AbsTime)
// fmt.Println("a", frame.Sequence, frame.Timestamp, s.AudioReader.AbsTime)
delta := uint32(s.AudioReader.SkipTs / time.Millisecond * time.Duration(s.AudioReader.Track.SampleRate) / 1000)
frame.RTP.Range(func(ap RTPFrame) bool {
audioSeq++

View File

@@ -60,6 +60,7 @@ func (g711 *G711) WriteAVCC(ts uint32, frame *util.BLL) error {
func (g711 *G711) WriteRTPFrame(rtpItem *util.ListItem[RTPFrame]) {
frame := &rtpItem.Value
g711.Value.RTP.Push(rtpItem)
if g711.SampleRate != 90000 {
g711.generateTimestamp(uint32(uint64(frame.Timestamp) * 90000 / uint64(g711.SampleRate)))
}

View File

@@ -139,6 +139,7 @@ func (vt *H265) WriteAVCC(ts uint32, frame *util.BLL) (err error) {
func (vt *H265) WriteRTPFrame(rtpItem *util.ListItem[RTPFrame]) {
frame := &rtpItem.Value
rv := vt.Value
rv.RTP.Push(rtpItem)
// TODO: DONL may need to be parsed if `sprop-max-don-diff` is greater than 0 on the RTP stream.
var usingDonlField bool
var buffer = util.Buffer(frame.Payload)