mirror of
https://github.com/ZoneMinder/zoneminder.git
synced 2026-03-25 17:22:22 -04:00
Rename locked_packet to packet_lock. Don't unlock packet as it crashes
This commit is contained in:
@@ -731,12 +731,12 @@ void Event::Run() {
|
||||
// The idea is to process the queue no matter what so that all packets get processed.
|
||||
// We only break if the queue is empty
|
||||
while (!terminate_ and !zm_terminate) {
|
||||
ZMPacketLock locked_packet = packetqueue->get_packet_no_wait(packetqueue_it);
|
||||
std::shared_ptr<ZMPacket> packet = locked_packet.packet_;
|
||||
ZMPacketLock packet_lock = packetqueue->get_packet_no_wait(packetqueue_it);
|
||||
std::shared_ptr<ZMPacket> packet = packet_lock.packet_;
|
||||
if (packet) {
|
||||
if (!packet->decoded) {
|
||||
Debug(1, "Not decoded");
|
||||
packet->unlock();
|
||||
packet_lock.unlock();
|
||||
// Stay behind decoder
|
||||
Microseconds sleep_for = Microseconds(ZM_SAMPLE_RATE);
|
||||
Debug(4, "Sleeping for %" PRId64 "us", int64(sleep_for.count()));
|
||||
@@ -762,8 +762,6 @@ void Event::Run() {
|
||||
packet->analysis_image = nullptr;
|
||||
}
|
||||
} // end if packet->image
|
||||
Debug(1, "Deleting packet lock");
|
||||
packet->unlock();
|
||||
// Important not to increment it until after we are done with the packet because clearPackets checks for iterators pointing to it.
|
||||
packetqueue->increment_it(packetqueue_it);
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user