diff --git a/src/motion_loop.cpp b/src/motion_loop.cpp index 7fcca29a..6d1b1ac2 100644 --- a/src/motion_loop.cpp +++ b/src/motion_loop.cpp @@ -553,7 +553,7 @@ static void mlp_init_values(ctx_dev *cam) clock_gettime(CLOCK_MONOTONIC, &cam->frame_last_ts); cam->noise = cam->conf->noise_level; - + cam->passflag = false; cam->threshold = cam->conf->threshold; cam->device_status = STATUS_CLOSED; cam->startup_frames = (cam->conf->framerate * 2) + cam->conf->pre_capture + cam->conf->minimum_motion_frames; @@ -1315,7 +1315,7 @@ static void mlp_parmsupdate(ctx_dev *cam) return; } - if (cam->parms_changed ) { + if (cam->parms_changed || (cam->passflag == false)) { draw_init_scale(cam); /* Initialize and validate text_scale */ if (cam->conf->picture_output == "on") { @@ -1421,7 +1421,7 @@ static void mlp_frametiming(ctx_dev *cam) SLEEP(0, avgtime); } } - cam->passflag = 1; + cam->passflag = true; } /** main processing loop for each camera */ diff --git a/src/motionplus.hpp b/src/motionplus.hpp index c62fc7d0..16efe249 100644 --- a/src/motionplus.hpp +++ b/src/motionplus.hpp @@ -473,7 +473,7 @@ struct ctx_dev { int smartmask_count; unsigned int smartmask_lastrate; int previous_diffs, previous_location_x, previous_location_y; - unsigned int passflag; //only purpose is to flag first frame vs all others..... + bool passflag; //flag first frame vs all others. pthread_mutex_t parms_lock; ctx_params *params; /* Device parameters*/ diff --git a/src/webu_stream.cpp b/src/webu_stream.cpp index d177dcf5..c4b75124 100644 --- a/src/webu_stream.cpp +++ b/src/webu_stream.cpp @@ -447,7 +447,7 @@ mhdrslt webu_stream_main(ctx_webui *webui) return MHD_NO; } - if ((webui->cam->passflag == 0) || (webui->cam->finish_dev)) { + if ((webui->cam->passflag == false) || (webui->cam->finish_dev)) { return MHD_NO; }