兼容Adoble FMLE推流工具

This commit is contained in:
yangjiechina
2024-12-13 19:46:44 +08:00
parent 6f72ccfeba
commit 5d0c51817c
5 changed files with 12 additions and 13 deletions

View File

@@ -75,7 +75,7 @@ func (t *transStream) Input(packet utils.AVPacket) ([][]byte, int64, bool, error
// 写chunk header
chunk.Length = payloadSize
chunk.Timestamp = uint32(dts)
n := chunk.ToBytes(allocate)
n := chunk.MarshalHeader(allocate)
// 写flv
if videoPkt {
@@ -84,7 +84,7 @@ func (t *transStream) Input(packet utils.AVPacket) ([][]byte, int64, bool, error
n += t.muxer.WriteAudioData(allocate[n:], false)
}
n += chunk.WriteData(allocate[n:], data, t.chunkSize, chunkPayloadOffset)
n += chunk.WriteBody(allocate[n:], data, t.chunkSize, chunkPayloadOffset)
utils.Assert(len(allocate) == n)
// 合并写满了再发
@@ -157,7 +157,7 @@ func (t *transStream) WriteHeader() error {
n += len(extra)
t.audioChunk.Length = n
t.audioChunk.ToBytes(t.header)
t.audioChunk.MarshalHeader(t.header)
n += 12
}
@@ -169,7 +169,7 @@ func (t *transStream) WriteHeader() error {
n += len(extra)
t.videoChunk.Length = 5 + len(extra)
t.videoChunk.ToBytes(t.header[tmp:])
t.videoChunk.MarshalHeader(t.header[tmp:])
n += 12
}