From 9be7547c8b620942f02da670159991335fbfa13f Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Sun, 27 Dec 2020 12:32:46 -0500 Subject: [PATCH] Look at stream index instead of image_index when finding first keyframe in packetqueue --- src/zm_packetqueue.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/zm_packetqueue.cpp b/src/zm_packetqueue.cpp index 358feb3a9..69d4eae23 100644 --- a/src/zm_packetqueue.cpp +++ b/src/zm_packetqueue.cpp @@ -477,10 +477,9 @@ std::list::iterator zm_packetqueue::get_event_start_packet_it( Debug(1, "Checking for keyframe begin %p", *(pktQueue.begin())); // snapshot it might already point to the beginning while ( ( it != pktQueue.begin() ) and pre_event_count ) { - Debug(1, "Previous packet pre %d index %d keyframe %d", pre_event_count, (*it)->image_index, (*it)->keyframe); + Debug(1, "Previous packet pre %d index %d keyframe %d", pre_event_count, (*it)->packet.stream_index, (*it)->keyframe); dumpPacket( &((*it)->packet ) ); - // Is video, maybe should compare stream_id instead - if ( (*it)->image_index != -1 ) { + if ( (*it)->packet.stream_index != video_stream_id ) { pre_event_count --; } it--;