From 727e1fe5bb368ba7c306e6cec0afc8dfbb2c8019 Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Sat, 15 Feb 2025 11:42:39 -0500 Subject: [PATCH] Add debug to not keeping keyframes case --- src/zm_packetqueue.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/zm_packetqueue.cpp b/src/zm_packetqueue.cpp index 0ad93df06..bbbdd28b4 100644 --- a/src/zm_packetqueue.cpp +++ b/src/zm_packetqueue.cpp @@ -265,9 +265,10 @@ void PacketQueue::clearPackets(const std::shared_ptr &add_packet) { if ((*it)->packet->stream_index == video_stream_id) ++tail_count; } - Debug(1, "Tail count is %d, queue size is %zu", tail_count, pktQueue.size()); + Debug(1, "Tail count is %d, queue size is %zu, video_packets %d", tail_count, pktQueue.size(), packet_counts[video_stream_id]); if (!keep_keyframes) { + Debug(3, "Not keeping keyframes"); // If not doing passthrough, we don't care about starting with a keyframe so logic is simpler while ((*pktQueue.begin() != add_packet) and (packet_counts[video_stream_id] > pre_event_video_packet_count + tail_count)) { std::shared_ptr zm_packet = *pktQueue.begin(); @@ -291,6 +292,8 @@ void PacketQueue::clearPackets(const std::shared_ptr &add_packet) { pre_event_video_packet_count, pktQueue.size()); } // end while + Debug(3, "Done removing packets from queue. packet_counts %d >? pre_event %d + tail %d = %d", + packet_counts[video_stream_id], pre_event_video_packet_count, tail_count, pre_event_video_packet_count + tail_count); return; }