Browse Source

rtmp server: fix bias error in AAC DTS

pull/956/head
aler9 4 years ago
parent
commit
0c4f6e2d43
  1. 6
      internal/core/rtmp_conn.go

6
internal/core/rtmp_conn.go

@ -423,18 +423,16 @@ func (c *rtmpConn) runRead(ctx context.Context) error { @@ -423,18 +423,16 @@ func (c *rtmpConn) runRead(ctx context.Context) error {
continue
}
for _, au := range aus {
for i, au := range aus {
c.conn.SetWriteDeadline(time.Now().Add(time.Duration(c.writeTimeout)))
err := c.conn.WritePacket(av.Packet{
Type: av.AAC,
Data: au,
Time: pts,
Time: pts + time.Duration(i)*aac.SamplesPerAccessUnit*time.Second/time.Duration(audioTrack.ClockRate()),
})
if err != nil {
return err
}
pts += aac.SamplesPerAccessUnit * time.Second / time.Duration(audioTrack.ClockRate())
}
}
}

Loading…
Cancel
Save