From 2f5dff72440a9264fb74277aa9713cc4eb353fa3 Mon Sep 17 00:00:00 2001 From: Peter Keresztes Schmidt Date: Wed, 10 Feb 2021 16:13:47 +0100 Subject: [PATCH] Monitor: Don't push packets into the packet queue when in Monitor mode There is no consumer for the packets in this mode, so don't queue them up. This saves quite a bit of RAM for mode of operation. --- src/zm_monitor.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/zm_monitor.cpp b/src/zm_monitor.cpp index 78e1eb278..d0ec78025 100644 --- a/src/zm_monitor.cpp +++ b/src/zm_monitor.cpp @@ -2613,7 +2613,8 @@ int Monitor::Capture() { shared_data->last_write_time = packet->timestamp->tv_sec; image_count++; - if ( packetqueue.packet_count(video_stream_id) or packet->keyframe or event ) { + if (GetFunction() != Function::MONITOR + and (packetqueue.packet_count(video_stream_id) or packet->keyframe or event)) { Debug(2, "Have video packet for image index (%d), adding to queue", index); packetqueue.queuePacket(packet); } else {