rtp packet sort set init seq

This commit is contained in:
xiongguangjie 2022-09-28 15:29:11 +08:00
parent 69736fdb63
commit bfebcd62c7

View File

@ -60,6 +60,10 @@ public:
* @param packet * @param packet
*/ */
void sortPacket(SEQ seq, T packet) { void sortPacket(SEQ seq, T packet) {
if(!_is_inited && _next_seq_out == 0){
_next_seq_out = seq;
_is_inited = true;
}
if (seq < _next_seq_out) { if (seq < _next_seq_out) {
if (_next_seq_out < seq + kMax) { if (_next_seq_out < seq + kMax) {
//过滤seq回退包(回环包除外) //过滤seq回退包(回环包除外)
@ -147,6 +151,9 @@ private:
} }
private: private:
//第一个包是已经进入
bool _is_inited = false;
//下次应该输出的SEQ //下次应该输出的SEQ
SEQ _next_seq_out = 0; SEQ _next_seq_out = 0;
//seq回环次数计数 //seq回环次数计数