@@ -311,15 +311,22 @@ void PacketQueue::clearPackets(const std::shared_ptr<ZMPacket> &add_packet) {
311
311
}
312
312
313
313
int keyframe_interval_count = 1 ;
314
+ int video_packets_to_delete = 0 ; // This is a count of how many packets we will delete so we know when to stop looking
314
315
315
316
ZMLockedPacket *lp = new ZMLockedPacket (zm_packet);
316
317
if (!lp->trylock ()) {
317
318
Debug (4 , " Failed getting lock on first packet" );
318
319
delete lp;
319
320
return ;
320
321
} // end if first packet not locked
322
+
323
+ if (is_there_an_iterator_pointing_to_packet (zm_packet)) {
324
+ Debug (3 , " Found iterator Counted %d video packets. Which would leave %d in packetqueue tail count is %d" ,
325
+ video_packets_to_delete, packet_counts[video_stream_id]-video_packets_to_delete, tail_count);
326
+ delete lp;
327
+ return ;
328
+ }
321
329
322
- int video_packets_to_delete = 0 ; // This is a count of how many packets we will delete so we know when to stop looking
323
330
++it;
324
331
delete lp;
325
332
@@ -335,7 +342,7 @@ void PacketQueue::clearPackets(const std::shared_ptr<ZMPacket> &add_packet) {
335
342
delete lp;
336
343
337
344
if (is_there_an_iterator_pointing_to_packet (zm_packet)) {
338
- Debug (3 , " Foudn iterator Counted %d video packets. Which would leave %d in packetqueue tail count is %d" ,
345
+ Debug (3 , " Found iterator Counted %d video packets. Which would leave %d in packetqueue tail count is %d" ,
339
346
video_packets_to_delete, packet_counts[video_stream_id]-video_packets_to_delete, tail_count);
340
347
break ;
341
348
}
@@ -595,6 +602,7 @@ packetqueue_iterator *PacketQueue::get_event_start_packet_it(
595
602
596
603
packetqueue_iterator *it = new packetqueue_iterator;
597
604
iterators.push_back (it);
605
+ Debug (4 , " Have event start iterator %p" , std::addressof (*it));
598
606
599
607
*it = snapshot_it;
600
608
std::shared_ptr<ZMPacket> packet = *(*it);
@@ -714,6 +722,7 @@ bool PacketQueue::is_there_an_iterator_pointing_to_packet(const std::shared_ptr<
714
722
) {
715
723
packetqueue_iterator *iterator_it = *iterators_it;
716
724
if (*iterator_it == pktQueue.end ()) {
725
+ Debug (4 , " Checking iterator %p == end" , std::addressof (*iterator_it));
717
726
continue ;
718
727
}
719
728
Debug (4 , " Checking iterator %p == packet ? %d" , std::addressof (*iterator_it), ( *(*iterator_it) == zm_packet ));
0 commit comments