From 7e42a85ebfdaffca33952e02f71332d1d62e35e9 Mon Sep 17 00:00:00 2001 From: dexter <178529795@qq.com> Date: Tue, 14 Mar 2023 09:35:36 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AF=B9=E4=BA=8Eavcc=E7=9A=84=E6=97=B6?= =?UTF-8?q?=E9=97=B4=E6=88=B3=E5=A6=82=E6=9E=9C=E4=B8=BA0=E5=88=99?= =?UTF-8?q?=E5=86=991=EF=BC=8C=E9=98=B2=E6=AD=A2=E5=90=8E=E9=9D=A2?= =?UTF-8?q?=E8=AF=AF=E5=88=A4=E6=88=90=E9=9D=9Ertmp=E4=BD=93=E7=B3=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- common/frame.go | 3 +++ subscriber.go | 1 + 2 files changed, 4 insertions(+) diff --git a/common/frame.go b/common/frame.go index 8a1fc27..ed21966 100644 --- a/common/frame.go +++ b/common/frame.go @@ -70,6 +70,9 @@ type AVFrame struct { } func (av *AVFrame) WriteAVCC(ts uint32, frame *util.BLL) { + if ts == 0 { + ts = 1 + } av.AbsTime = ts av.BytesIn += frame.ByteLength for { diff --git a/subscriber.go b/subscriber.go index a1b69e8..ff181a3 100644 --- a/subscriber.go +++ b/subscriber.go @@ -238,6 +238,7 @@ func (s *Subscriber) PlayBlock(subType byte) { case SUBTYPE_FLV: flvHeadCache := make([]byte, 15) //内存复用 sendFlvFrame := func(t byte, ts uint32, avcc ...[]byte) { + // fmt.Println(ts) flvHeadCache[0] = t result := append(FLVFrame{flvHeadCache[:11]}, avcc...) dataSize := uint32(util.SizeOfBuffers(avcc))