From a0df09dcaaebd3dd622c8f6c9c3245817cd40a49 Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Mon, 25 Jan 2021 12:07:56 -0500 Subject: [PATCH] Have to check for lock on video keyframe as well --- src/zm_packetqueue.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/zm_packetqueue.cpp b/src/zm_packetqueue.cpp index bd9c4547c..366f308c2 100644 --- a/src/zm_packetqueue.cpp +++ b/src/zm_packetqueue.cpp @@ -117,6 +117,11 @@ bool zm_packetqueue::queuePacket(ZMPacket* add_packet) { if ( zm_packet->packet.stream_index == video_stream_id ) { if ( zm_packet->keyframe ) { Debug(1, "Have a video keyframe so breaking out"); + if ( !zm_packet->trylock() ) { + Debug(1, "Have locked packet %d", zm_packet->image_index); + video_stream_packets = max_video_packet_count; + } + zm_packet->unlock(); break; } video_stream_packets ++;