mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2024-11-26 20:47:08 +08:00
修复rtmp协议amf3不兼容的bug
This commit is contained in:
parent
c8e4c916bf
commit
7884338b60
@ -354,7 +354,7 @@ void RtmpPlayer::onRtmpChunk(RtmpPacket::Ptr packet) {
|
|||||||
case MSG_CMD3:
|
case MSG_CMD3:
|
||||||
case MSG_DATA:
|
case MSG_DATA:
|
||||||
case MSG_DATA3: {
|
case MSG_DATA3: {
|
||||||
AMFDecoder dec(chunk_data.buffer, 0);
|
AMFDecoder dec(chunk_data.buffer, 0, (chunk_data.type_id == MSG_DATA3 || chunk_data.type_id == MSG_CMD3) ? 3 : 0);
|
||||||
std::string type = dec.load<std::string>();
|
std::string type = dec.load<std::string>();
|
||||||
auto it = s_func_map.find(type);
|
auto it = s_func_map.find(type);
|
||||||
if (it != s_func_map.end()) {
|
if (it != s_func_map.end()) {
|
||||||
|
@ -292,7 +292,7 @@ void RtmpPusher::onRtmpChunk(RtmpPacket::Ptr packet) {
|
|||||||
g_mapCmd.emplace("onStatus", &RtmpPusher::onCmd_onStatus);
|
g_mapCmd.emplace("onStatus", &RtmpPusher::onCmd_onStatus);
|
||||||
});
|
});
|
||||||
|
|
||||||
AMFDecoder dec(chunk_data.buffer, 0);
|
AMFDecoder dec(chunk_data.buffer, 0, chunk_data.type_id == MSG_CMD3 ? 3 : 0);
|
||||||
std::string type = dec.load<std::string>();
|
std::string type = dec.load<std::string>();
|
||||||
auto it = g_mapCmd.find(type);
|
auto it = g_mapCmd.find(type);
|
||||||
if (it != g_mapCmd.end()) {
|
if (it != g_mapCmd.end()) {
|
||||||
|
@ -452,14 +452,14 @@ void RtmpSession::onRtmpChunk(RtmpPacket::Ptr packet) {
|
|||||||
switch (chunk_data.type_id) {
|
switch (chunk_data.type_id) {
|
||||||
case MSG_CMD:
|
case MSG_CMD:
|
||||||
case MSG_CMD3: {
|
case MSG_CMD3: {
|
||||||
AMFDecoder dec(chunk_data.buffer, chunk_data.type_id == MSG_CMD3 ? 1 : 0);
|
AMFDecoder dec(chunk_data.buffer, chunk_data.type_id == MSG_CMD3 ? 3 : 0);
|
||||||
onProcessCmd(dec);
|
onProcessCmd(dec);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case MSG_DATA:
|
case MSG_DATA:
|
||||||
case MSG_DATA3: {
|
case MSG_DATA3: {
|
||||||
AMFDecoder dec(chunk_data.buffer, chunk_data.type_id == MSG_CMD3 ? 1 : 0);
|
AMFDecoder dec(chunk_data.buffer, chunk_data.type_id == MSG_DATA3 ? 3 : 0);
|
||||||
std::string type = dec.load<std::string>();
|
std::string type = dec.load<std::string>();
|
||||||
if (type == "@setDataFrame") {
|
if (type == "@setDataFrame") {
|
||||||
setMetaData(dec);
|
setMetaData(dec);
|
||||||
|
Loading…
Reference in New Issue
Block a user