From 4c11d29bcbc26b442967677d8ae6b9a8d9c047aa Mon Sep 17 00:00:00 2001 From: ydajiang Date: Fri, 11 Apr 2025 16:37:37 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20rtmp=E6=97=B6=E9=97=B4=E6=88=B3=E8=B6=85?= =?UTF-8?q?=E8=BF=870xFFFFFF=E5=B0=81=E8=A3=85=E6=B5=81=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- rtmp/rtmp_stream.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rtmp/rtmp_stream.go b/rtmp/rtmp_stream.go index 197914e..57b0a69 100644 --- a/rtmp/rtmp_stream.go +++ b/rtmp/rtmp_stream.go @@ -72,7 +72,7 @@ func (t *transStream) Input(packet *avformat.AVPacket) ([][]byte, int64, bool, e // 整个chunk大小 totalSize := chunkHeaderSize + payloadSize + numChunks // 如果时间戳超过3字节, 每个chunk都需要多4字节的扩展时间戳 - if dts >= 0xFFFFFF && dts >= 0xFFFFFFFF { + if dts >= 0xFFFFFF { totalSize += (1 + numChunks) * 4 } @@ -89,7 +89,7 @@ func (t *transStream) Input(packet *avformat.AVPacket) ([][]byte, int64, bool, e utils.Assert(ok) } - // 写第一个type为0的chunk sequenceHeader + // 写第一个type为0的chunk chunk.Length = payloadSize chunk.Timestamp = uint32(dts) n := chunk.MarshalHeader(bytes)