Remove check for pktQueue.size(). We know that there are packets in it

pull/3477/head
Isaac Connor 2022-04-27 15:15:30 -04:00
parent 554217931c
commit 9935e4011c
1 changed files with 2 additions and 1 deletions

View File

@ -216,8 +216,9 @@ void PacketQueue::clearPackets(const std::shared_ptr<ZMPacket> &add_packet) {
// //
// So start at the beginning, counting video packets until the next keyframe. // So start at the beginning, counting video packets until the next keyframe.
// Then if deleting those packets doesn't break 1 and 2, then go ahead and delete them. // Then if deleting those packets doesn't break 1 and 2, then go ahead and delete them.
//
// One assumption that we can make is that there will be packets in the queue. Because we call it while holding a locked packet
if (deleting) return; if (deleting) return;
if (!pktQueue.size()) return;
if (keep_keyframes and ! ( if (keep_keyframes and ! (
add_packet->packet.stream_index == video_stream_id add_packet->packet.stream_index == video_stream_id