put back code to close an event when idle, at section_length when using CLOSE_MODE==idle

pull/3600/head
Isaac Connor 2022-09-21 12:32:08 -04:00
parent 9d6d5a242f
commit 895adcb4c4
1 changed files with 11 additions and 1 deletions

View File

@ -2213,7 +2213,17 @@ bool Monitor::Analyse() {
if ((noteSetMap.size() > 0) and event)
event->updateNotes(noteSetMap);
} else if (state == TAPE) {
// bulk frame code moved to event.
if (event) {
if (section_length >= Seconds(min_section_length) && (event->Duration() >= section_length)) {
Debug(1, "%s: event %" PRIu64 ", has exceeded desired section length. %" PRIi64 " - %" PRIi64 " = %" PRIi64 " >= %" PRIi64,
name.c_str(), analysis_image_count, event->Id(),
static_cast<int64>(std::chrono::duration_cast<Seconds>(snap->timestamp.time_since_epoch()).count()),
static_cast<int64>(std::chrono::duration_cast<Seconds>(event->StartTime().time_since_epoch()).count()),
static_cast<int64>(std::chrono::duration_cast<Seconds>(event->Duration()).count()),
static_cast<int64>(Seconds(section_length).count()));
closeEvent();
}
}
} // end if state machine
if (shared_data->recording > RECORDING_NONE) {