diff --git a/src/alg_sec.cpp b/src/alg_sec.cpp index b998f526..84376dc6 100644 --- a/src/alg_sec.cpp +++ b/src/alg_sec.cpp @@ -541,7 +541,7 @@ void algsec_init(ctx_cam *cam) mythreadname_set("ml",cam->threadnr,cam->conf->camera_name.c_str()); #else - (void)cam; + cam->algsec_inuse = false; #endif } diff --git a/src/motion_loop.cpp b/src/motion_loop.cpp index 66847e66..3fe5f5fd 100644 --- a/src/motion_loop.cpp +++ b/src/motion_loop.cpp @@ -204,6 +204,10 @@ static void mlp_detected_trigger(struct ctx_cam *cam, struct ctx_image_data *img cam->prev_event = cam->event_nr; cam->eventtime = img->imgts.tv_sec; + if (cam->algsec_inuse) { + cam->algsec->isdetected = false; + } + mystrftime(cam, cam->text_event_string, sizeof(cam->text_event_string), cam->conf->text_event.c_str(), &img->imgts, NULL, 0); diff --git a/src/util.cpp b/src/util.cpp index 90900483..7bd86394 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -22,6 +22,7 @@ #include "conf.hpp" #include "util.hpp" #include "logger.hpp" +#include "alg_sec.hpp" /* For sec detect in format output */ #include "dbse.hpp" /*For dbse ID in format output */ @@ -304,6 +305,19 @@ static void mystrftime_long (const struct ctx_cam *cam, sprintf(out, "%*d", width, cam->current_image->diffs_ratio); return; } + if (SPECIFIERWORD("secdetect")) { + if (cam->algsec_inuse) { + if (cam->algsec->isdetected) { + sprintf(out, "%*s", width, "Y"); + } else { + sprintf(out, "%*s", width, "N"); + } + } else { + sprintf(out, "%*s", width, "N"); + } + return; + } + // Not a valid modifier keyword. Log the error and ignore. MOTION_LOG(ERR, TYPE_ALL, NO_ERRNO,