ignore "checkBandwidth" and "_checkbw" command,don't treat them as republish
正在显示
3 个修改的文件
包含
10 行增加
和
1 行删除
@@ -990,6 +990,9 @@ int SrsRtmpConn::handle_publish_message(SrsSource* source, SrsCommonMessage* msg | @@ -990,6 +990,9 @@ int SrsRtmpConn::handle_publish_message(SrsSource* source, SrsCommonMessage* msg | ||
990 | srs_error("fmle decode unpublish message failed. ret=%d", ret); | 990 | srs_error("fmle decode unpublish message failed. ret=%d", ret); |
991 | return ret; | 991 | return ret; |
992 | } | 992 | } |
993 | + if(NULL == pkt){ | ||
994 | + return ret;//ignored packets,don't do republish | ||
995 | + } | ||
993 | SrsAutoFree(SrsPacket, pkt); | 996 | SrsAutoFree(SrsPacket, pkt); |
994 | 997 | ||
995 | // for flash, any packet is republish. | 998 | // for flash, any packet is republish. |
@@ -838,7 +838,11 @@ int SrsProtocol::do_decode_message(SrsMessageHeader& header, SrsStream* stream, | @@ -838,7 +838,11 @@ int SrsProtocol::do_decode_message(SrsMessageHeader& header, SrsStream* stream, | ||
838 | srs_info("decode the AMF0/AMF3 closeStream message."); | 838 | srs_info("decode the AMF0/AMF3 closeStream message."); |
839 | *ppacket = packet = new SrsCloseStreamPacket(); | 839 | *ppacket = packet = new SrsCloseStreamPacket(); |
840 | return packet->decode(stream); | 840 | return packet->decode(stream); |
841 | - } else if (header.is_amf0_command() || header.is_amf3_command()) { | 841 | + }else if (command == RTMP_AMF0_COMMAND_CHECKBANDWIDTH || command == RTMP_AMF0_COMMAND_CHECKBW) { |
842 | + //todo: process check bandwidth command,now drop it | ||
843 | + return ret; | ||
844 | + } | ||
845 | + else if (header.is_amf0_command() || header.is_amf3_command()) { | ||
842 | srs_info("decode the AMF0/AMF3 call message."); | 846 | srs_info("decode the AMF0/AMF3 call message."); |
843 | *ppacket = packet = new SrsCallPacket(); | 847 | *ppacket = packet = new SrsCallPacket(); |
844 | return packet->decode(stream); | 848 | return packet->decode(stream); |
@@ -91,6 +91,8 @@ class IMergeReadHandler; | @@ -91,6 +91,8 @@ class IMergeReadHandler; | ||
91 | #define RTMP_AMF0_COMMAND_PUBLISH "publish" | 91 | #define RTMP_AMF0_COMMAND_PUBLISH "publish" |
92 | #define RTMP_AMF0_DATA_SAMPLE_ACCESS "|RtmpSampleAccess" | 92 | #define RTMP_AMF0_DATA_SAMPLE_ACCESS "|RtmpSampleAccess" |
93 | 93 | ||
94 | +#define RTMP_AMF0_COMMAND_CHECKBANDWIDTH "checkBandwidth" | ||
95 | +#define RTMP_AMF0_COMMAND_CHECKBW "_checkbw" | ||
94 | /** | 96 | /** |
95 | * the signature for packets to client. | 97 | * the signature for packets to client. |
96 | */ | 98 | */ |
-
请 注册 或 登录 后发表评论