Count keyframes on queuePacket so that analysis Ready() will start when out of order packets are present

pull/4202/head
Isaac Connor 2023-08-23 11:41:54 -04:00
parent 2770a9caa7
commit 90dc655090
1 changed files with 11 additions and 0 deletions

View File

@ -107,6 +107,17 @@ bool PacketQueue::queuePacket(std::shared_ptr<ZMPacket> add_packet) {
}
rit++;
} // end while
} else if (!max_keyframe_interval_ and add_packet->keyframe) {
auto rit = pktQueue.rbegin();
int packet_count = 0;
while (rit != pktQueue.rend()) {
if ((*rit)->packet->stream_index == add_packet->packet->stream_index) {
if ((*rit)->keyframe) break;
packet_count ++;
}
}
Debug(1, "Have keyframe interval: %d", packet_count);
max_keyframe_interval_ = packet_count;
}
pktQueue.push_back(add_packet);