修复rtmp无法播放问题

This commit is contained in:
langhuihui
2020-03-22 20:45:03 +08:00
parent 3f64c5a398
commit 3291d59b49
7 changed files with 89 additions and 25 deletions

6
msg.go
View File

@@ -2,9 +2,10 @@ package rtmpplugin
import (
"bytes"
"github.com/Monibuca/engine/util"
"log"
"sync"
"github.com/Monibuca/engine/util"
)
const (
@@ -78,6 +79,9 @@ var (
func newChunkHeader(messageType byte) *ChunkHeader {
head := rtmpHeaderPool.Get().(*ChunkHeader)
head.ChunkStreamID = RTMP_CSID_CONTROL
if messageType == RTMP_MSG_AMF0_COMMAND {
head.ChunkStreamID = RTMP_CSID_COMMAND
}
head.Timestamp = 0
head.MessageTypeID = messageType
head.MessageStreamID = 0