diff --git a/src/zm_packetqueue.cpp b/src/zm_packetqueue.cpp index 1164f556f..0b4473389 100644 --- a/src/zm_packetqueue.cpp +++ b/src/zm_packetqueue.cpp @@ -479,6 +479,7 @@ bool zm_packetqueue::increment_it(packetqueue_iterator *it, int stream_id) { return false; } + std::unique_lock lck(mutex); do { ++(*it); } while ( (*it != pktQueue.end()) and ( (*(*it))->packet.stream_index != stream_id) );