修复zlm推流FMS,修正zlm的RTMP协议 (#1140)

* 修复zlm推流FMS,修正zlm的RTMP协议
Co-authored-by: 夏楚 <771730766@qq.com>
This commit is contained in:
haorui wang
2021-09-29 16:57:19 +08:00
committed by GitHub
parent 1292ec6d49
commit adc6f652bd
2 changed files with 9 additions and 2 deletions

View File

@@ -165,7 +165,13 @@ void RtmpProtocol::sendInvoke(const string &cmd, const AMFValue &val) {
}
void RtmpProtocol::sendRequest(int cmd, const string& str) {
sendRtmp(cmd, _stream_index, str, 0, CHUNK_SERVER_REQUEST);
if (cmd <= MSG_SET_PEER_BW) {
// 若 cmd 属于 Protocol Control Messages ,则应使用 chunk id 2 发送
sendRtmp(cmd, _stream_index, str, 0, CHUNK_NETWORK);
} else {
// 否则使用 chunk id 发送(任意值3-128参见 obs 及 ffmpeg 选取 3)
sendRtmp(cmd, _stream_index, str, 0, CHUNK_SYSTEM);
}
}
class BufferPartial : public Buffer {