From bfebcd62c7d6748c54b89adebfbc63300e798aa9 Mon Sep 17 00:00:00 2001 From: xiongguangjie Date: Wed, 28 Sep 2022 15:29:11 +0800 Subject: [PATCH] rtp packet sort set init seq --- src/Rtsp/RtpReceiver.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/Rtsp/RtpReceiver.h b/src/Rtsp/RtpReceiver.h index d7ec3efe..f855d604 100644 --- a/src/Rtsp/RtpReceiver.h +++ b/src/Rtsp/RtpReceiver.h @@ -60,6 +60,10 @@ public: * @param 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 (_next_seq_out < seq + kMax) { //过滤seq回退包(回环包除外) @@ -147,6 +151,9 @@ private: } private: + //第一个包是已经进入 + bool _is_inited = false; + //下次应该输出的SEQ SEQ _next_seq_out = 0; //seq回环次数计数