wait won't wake up other threads, so notify first. Since we have the lock, this should be ok

This commit is contained in:
Isaac Connor 2021-09-15 12:53:41 -04:00
parent 03f0762709
commit d2cf89565e
1 changed files with 1 additions and 0 deletions

View File

@ -133,6 +133,7 @@ bool PacketQueue::queuePacket(std::shared_ptr<ZMPacket> add_packet) {
if (max_video_packet_count > 0) { if (max_video_packet_count > 0) {
while (packet_counts[video_stream_id] > max_video_packet_count) { while (packet_counts[video_stream_id] > max_video_packet_count) {
Error("Unable to free up older packets. Waiting."); Error("Unable to free up older packets. Waiting.");
condition.notify_all();
condition.wait(lck); condition.wait(lck);
if (deleting or zm_terminate) if (deleting or zm_terminate)
return false; return false;