From 6f05cf803d4f11a5494c1ab33d7f834980f10292 Mon Sep 17 00:00:00 2001 From: xiongguangjie Date: Sat, 4 Jun 2022 22:42:28 +0800 Subject: [PATCH] prevent cycle for time lantency and available size --- srt/PacketQueue.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/srt/PacketQueue.cpp b/srt/PacketQueue.cpp index e9b51505..2ee6db9a 100644 --- a/srt/PacketQueue.cpp +++ b/srt/PacketQueue.cpp @@ -111,6 +111,7 @@ uint32_t PacketQueue::timeLantency() { } if(dur > 0x80000000){ + //WarnL<<"cycle dur "<first - _pkt_expected_seq+1; + auto size = _pkt_map.rbegin()->first - _pkt_expected_seq+1; + if(size >= _pkt_cap){ + // 回环 + //WarnL<<"cycle size "<