mirror of
https://github.com/bluenviron/mediamtx.git
synced 2025-12-25 12:32:01 -08:00
rtmp server: fix bias error in AAC DTS
This commit is contained in:
parent
b6b99b142a
commit
0c4f6e2d43
1 changed files with 2 additions and 4 deletions
|
|
@ -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…
Add table
Add a link
Reference in a new issue