修复rtmp音视频不同步问题

This commit is contained in:
yangjiechina
2024-06-23 13:45:52 +08:00
parent e88c243efa
commit 8d886d1444
3 changed files with 5 additions and 17 deletions

View File

@@ -36,14 +36,8 @@ func (t *transStream) Input(packet utils.AVPacket) error {
var pts int64
chunkHeaderSize := 12
if utils.AVCodecIdAAC == packet.CodecId() {
dts = packet.ConvertDts(1024)
pts = packet.ConvertPts(1024)
} else {
dts = packet.ConvertDts(1000)
pts = packet.ConvertPts(1000)
}
dts = packet.ConvertDts(1000)
pts = packet.ConvertPts(1000)
if dts >= 0xFFFFFF {
chunkHeaderSize += 4
}