From 61c3c0d565a4008ba7704fef03c85a19486d138e Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Tue, 2 Feb 2021 14:23:08 -0500 Subject: [PATCH] Should increment_it after releasing the packet to prevent deadlock --- src/zm_rtsp_server_device_source.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/zm_rtsp_server_device_source.cpp b/src/zm_rtsp_server_device_source.cpp index 3ac8889cb..d35d8abd9 100644 --- a/src/zm_rtsp_server_device_source.cpp +++ b/src/zm_rtsp_server_device_source.cpp @@ -154,7 +154,6 @@ int ZoneMinderDeviceSource::getNextFrame() { } // packet is locked AVPacket *pkt = &zm_packet->packet; - m_packetqueue->increment_it(m_packetqueue_it, m_stream->index); // Convert pts to timeval int64_t pts = av_rescale_q(pkt->dts, m_stream->time_base, AV_TIME_BASE_Q); @@ -165,6 +164,7 @@ int ZoneMinderDeviceSource::getNextFrame() { std::list< std::pair > framesList = this->splitFrames(pkt->data, pkt->size); zm_packet->unlock(); zm_packet = nullptr;// we no longer have the lock so shouldn't be accessing it + m_packetqueue->increment_it(m_packetqueue_it, m_stream->index); while ( framesList.size() ) { std::pair nal = framesList.front();