Skip to content

Commit

Permalink
when counting keyframe interval in clearPackets start at 0. Reset max…
Browse files Browse the repository at this point in the history
…_keyframe_interval when clearing packetqueue. This prevents errors in log when using ondemand capture
  • Loading branch information
Isaac Connor committed Oct 24, 2024
1 parent 8496ce6 commit dadd9e2
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/zm_packetqueue.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ void PacketQueue::clearPackets(const std::shared_ptr<ZMPacket> &add_packet) {
return;
}

int keyframe_interval_count = 1;
int keyframe_interval_count = 0;
int video_packets_to_delete = 0; // This is a count of how many packets we will delete so we know when to stop looking

ZMLockedPacket *lp = new ZMLockedPacket(zm_packet);
Expand Down Expand Up @@ -428,6 +428,7 @@ void PacketQueue::clear() {
delete[] packet_counts;
packet_counts = nullptr;
max_stream_id = -1;
max_keyframe_interval_ = 0;

Debug(1, "Packetqueue is clear, notifying");
condition.notify_all();
Expand Down

0 comments on commit dadd9e2

Please sign in to comment.