From 9935e4011c5136c7703878f15620d69af6db5bde Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Wed, 27 Apr 2022 15:15:30 -0400 Subject: [PATCH] Remove check for pktQueue.size(). We know that there are packets in it --- src/zm_packetqueue.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/zm_packetqueue.cpp b/src/zm_packetqueue.cpp index 04ef89602..f03395bc1 100644 --- a/src/zm_packetqueue.cpp +++ b/src/zm_packetqueue.cpp @@ -216,8 +216,9 @@ void PacketQueue::clearPackets(const std::shared_ptr &add_packet) { // // So start at the beginning, counting video packets until the next keyframe. // Then if deleting those packets doesn't break 1 and 2, then go ahead and delete them. + // + // One assumption that we can make is that there will be packets in the queue. Because we call it while holding a locked packet if (deleting) return; - if (!pktQueue.size()) return; if (keep_keyframes and ! ( add_packet->packet.stream_index == video_stream_id