sigh. Move the snap unlock further down protecting another use of snap. Use a video test instead of image count to determine videoness of the snap

This commit is contained in:
Isaac Connor 2021-05-08 12:35:28 -04:00
parent bd6566a819
commit d3e91da514
1 changed files with 2 additions and 2 deletions

View File

@ -2305,15 +2305,15 @@ bool Monitor::Analyse() {
}
packetqueue.clearPackets(snap);
packetqueue.unlock(packet_lock);
if ( snap->image_index > 0 ) {
if (snap->codec_type == AVMEDIA_TYPE_VIDEO) {
// Only do these if it's a video packet.
shared_data->last_read_index = snap->image_index;
analysis_image_count++;
if ( function == MODECT or function == MOCORD )
UpdateAnalysisFPS();
}
packetqueue.unlock(packet_lock);
shared_data->last_read_time = time(nullptr);
return true;