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 cddb9d88bf
commit 38cda24b53
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) {
while (packet_counts[video_stream_id] > max_video_packet_count) {
Error("Unable to free up older packets. Waiting.");
condition.notify_all();
condition.wait(lck);
if (deleting or zm_terminate)
return false;