mirror of
https://github.com/Monibuca/engine.git
synced 2025-10-17 06:00:48 +08:00
对于avcc的时间戳如果为0则写1,防止后面误判成非rtmp体系
This commit is contained in:
@@ -70,6 +70,9 @@ type AVFrame struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (av *AVFrame) WriteAVCC(ts uint32, frame *util.BLL) {
|
func (av *AVFrame) WriteAVCC(ts uint32, frame *util.BLL) {
|
||||||
|
if ts == 0 {
|
||||||
|
ts = 1
|
||||||
|
}
|
||||||
av.AbsTime = ts
|
av.AbsTime = ts
|
||||||
av.BytesIn += frame.ByteLength
|
av.BytesIn += frame.ByteLength
|
||||||
for {
|
for {
|
||||||
|
@@ -238,6 +238,7 @@ func (s *Subscriber) PlayBlock(subType byte) {
|
|||||||
case SUBTYPE_FLV:
|
case SUBTYPE_FLV:
|
||||||
flvHeadCache := make([]byte, 15) //内存复用
|
flvHeadCache := make([]byte, 15) //内存复用
|
||||||
sendFlvFrame := func(t byte, ts uint32, avcc ...[]byte) {
|
sendFlvFrame := func(t byte, ts uint32, avcc ...[]byte) {
|
||||||
|
// fmt.Println(ts)
|
||||||
flvHeadCache[0] = t
|
flvHeadCache[0] = t
|
||||||
result := append(FLVFrame{flvHeadCache[:11]}, avcc...)
|
result := append(FLVFrame{flvHeadCache[:11]}, avcc...)
|
||||||
dataSize := uint32(util.SizeOfBuffers(avcc))
|
dataSize := uint32(util.SizeOfBuffers(avcc))
|
||||||
|
Reference in New Issue
Block a user