Merge branch 'master' of https://gitee.com/xia-chu/ZLMediaKit into dev

This commit is contained in:
xia-chu
2021-04-23 09:43:08 +08:00
4 changed files with 88 additions and 6 deletions

View File

@@ -42,7 +42,7 @@ bool RtpReceiver::handleOneRtp(int index, TrackType type, int sample_rate, uint8
}
RtpHeader *header = (RtpHeader *) ptr;
if (header->version != RtpPacket::kRtpVersion) {
throw std::invalid_argument("非法的rtpversion字段非法");
throw BadRtpException("非法的rtpversion字段非法");
}
if (!header->getPayloadSize(len)) {
//无有效负载的rtp包

View File

@@ -165,6 +165,13 @@ public:
RtpReceiver();
virtual ~RtpReceiver();
class BadRtpException : public invalid_argument {
public:
template<typename Type>
BadRtpException(Type &&type) : invalid_argument(std::forward<Type>(type)) {}
~BadRtpException() = default;
};
protected:
/**
* 输入数据指针生成并排序rtp包