Only update frame time if it is older

This commit is contained in:
Nicolas Mowen 2024-04-01 16:05:37 -06:00
parent bd70bf1c31
commit d75756164a

View File

@ -160,6 +160,7 @@ class ReviewSegmentMaintainer(threading.Thread):
active_objects = get_active_objects(frame_time, camera_config, objects)
if len(active_objects) > 0:
if frame_time > segment.last_update:
segment.last_update = frame_time
# update type for this segment now that active objects are detected
@ -198,6 +199,7 @@ class ReviewSegmentMaintainer(threading.Thread):
segment.severity == SeverityEnum.signification_motion
and len(motion) >= THRESHOLD_MOTION_ACTIVITY
):
if frame_time > segment.last_update:
segment.last_update = frame_time
else:
if segment.severity == SeverityEnum.alert and frame_time > (
@ -317,7 +319,9 @@ class ReviewSegmentMaintainer(threading.Thread):
motion_boxes,
)
elif topic == DetectionTypeEnum.audio and len(audio_detections) > 0:
if frame_time > current_segment.last_update:
current_segment.last_update = frame_time
current_segment.audio.update(audio_detections)
else:
if topic == DetectionTypeEnum.video: