Skip to content
This repository was archived by the owner on Apr 5, 2025. It is now read-only.

Commit 4ce4ca4

Browse files
committed
Initialize picture parameters. Closes #47
1 parent 9e61018 commit 4ce4ca4

3 files changed

Lines changed: 5 additions & 5 deletions

File tree

src/motion_loop.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -553,7 +553,7 @@ static void mlp_init_values(ctx_dev *cam)
553553
clock_gettime(CLOCK_MONOTONIC, &cam->frame_last_ts);
554554

555555
cam->noise = cam->conf->noise_level;
556-
556+
cam->passflag = false;
557557
cam->threshold = cam->conf->threshold;
558558
cam->device_status = STATUS_CLOSED;
559559
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)
13151315
return;
13161316
}
13171317

1318-
if (cam->parms_changed ) {
1318+
if (cam->parms_changed || (cam->passflag == false)) {
13191319
draw_init_scale(cam); /* Initialize and validate text_scale */
13201320

13211321
if (cam->conf->picture_output == "on") {
@@ -1421,7 +1421,7 @@ static void mlp_frametiming(ctx_dev *cam)
14211421
SLEEP(0, avgtime);
14221422
}
14231423
}
1424-
cam->passflag = 1;
1424+
cam->passflag = true;
14251425
}
14261426

14271427
/** main processing loop for each camera */

src/motionplus.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -473,7 +473,7 @@ struct ctx_dev {
473473
int smartmask_count;
474474
unsigned int smartmask_lastrate;
475475
int previous_diffs, previous_location_x, previous_location_y;
476-
unsigned int passflag; //only purpose is to flag first frame vs all others.....
476+
bool passflag; //flag first frame vs all others.
477477

478478
pthread_mutex_t parms_lock;
479479
ctx_params *params; /* Device parameters*/

src/webu_stream.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -447,7 +447,7 @@ mhdrslt webu_stream_main(ctx_webui *webui)
447447
return MHD_NO;
448448
}
449449

450-
if ((webui->cam->passflag == 0) || (webui->cam->finish_dev)) {
450+
if ((webui->cam->passflag == false) || (webui->cam->finish_dev)) {
451451
return MHD_NO;
452452
}
453453

0 commit comments

Comments
 (0)