diff --git a/src/motion_loop.cpp b/src/motion_loop.cpp index 1ed979cf..75fd7780 100644 --- a/src/motion_loop.cpp +++ b/src/motion_loop.cpp @@ -423,7 +423,7 @@ static void mlp_init_camera_type(ctx_dev *cam) , _("Unable to determine camera type")); cam->camera_type = CAMERA_TYPE_UNKNOWN; cam->finish_dev = true; - cam->restart_cam = false; + cam->restart_dev = false; } } @@ -1433,7 +1433,7 @@ void *motion_loop(void *arg) pthread_setspecific(tls_key_threadnr, (void *)((unsigned long)cam->threadnr)); cam->finish_dev = false; - cam->restart_cam = false; + cam->restart_dev = false; cam->camera_status = STATUS_INIT; while (cam->finish_dev == false) { diff --git a/src/motionplus.cpp b/src/motionplus.cpp index bcdfaba4..52b3b608 100644 --- a/src/motionplus.cpp +++ b/src/motionplus.cpp @@ -70,7 +70,7 @@ static void motion_signal_process(ctx_motapp *motapp) while (motapp->cam_list[indx]) { motapp->cam_list[indx]->event_stop = true; motapp->cam_list[indx]->finish_dev = true; - motapp->cam_list[indx]->restart_cam = false; + motapp->cam_list[indx]->restart_dev = false; indx++; } } @@ -419,7 +419,7 @@ static void motion_start_thread(ctx_motapp *motapp, int indx) pthread_attr_init(&thread_attr); pthread_attr_setdetachstate(&thread_attr, PTHREAD_CREATE_DETACHED); - motapp->cam_list[indx]->restart_cam = true; + motapp->cam_list[indx]->restart_dev = true; retcd = pthread_create(&motapp->cam_list[indx]->thread_id , &thread_attr, &motion_loop, motapp->cam_list[indx]); @@ -529,7 +529,7 @@ static void motion_watchdog(ctx_motapp *motapp, int camindx) pthread_kill(motapp->cam_list[indx]->thread_id, SIGVTALRM); }; motapp->cam_list[indx]->running_cam = false; - motapp->cam_list[indx]->restart_cam = false; + motapp->cam_list[indx]->restart_dev = false; indx++; } motapp->restart_all = true; @@ -546,7 +546,7 @@ static int motion_check_threadcount(ctx_motapp *motapp) thrdcnt = 0; for (indx=0; indxcam_cnt; indx++) { - if (motapp->cam_list[indx]->running_cam || motapp->cam_list[indx]->restart_cam) { + if (motapp->cam_list[indx]->running_cam || motapp->cam_list[indx]->restart_dev) { thrdcnt++; } } @@ -657,7 +657,7 @@ static void motion_cam_delete(ctx_motapp *motapp) MOTION_LOG(NTC, TYPE_STREAM, NO_ERRNO, _("Stopping %s camera_id %d") , cam->conf->camera_name.c_str(), cam->camera_id); - cam->restart_cam = false; + cam->restart_dev = false; cam->finish_dev = true; maxcnt = 100; @@ -737,7 +737,7 @@ int main (int argc, char **argv) for (indx=0; indxcam_cnt; indx++) { /* Check if threads wants to be restarted */ if ((motapp->cam_list[indx]->running_cam == false) && - (motapp->cam_list[indx]->restart_cam == true)) { + (motapp->cam_list[indx]->restart_dev == true)) { MOTION_LOG(NTC, TYPE_ALL, NO_ERRNO ,_("MotionPlus camera %d restart") , motapp->cam_list[indx]->camera_id); diff --git a/src/motionplus.hpp b/src/motionplus.hpp index 8e7ea43c..ece02e4b 100644 --- a/src/motionplus.hpp +++ b/src/motionplus.hpp @@ -341,7 +341,7 @@ struct ctx_dev { volatile bool event_stop; /* Boolean for whether to stop a event */ volatile bool event_user; /* Boolean for whether to user triggered an event */ volatile bool finish_dev; /* End the device thread */ - volatile bool restart_cam; /* Restart the thread when it ends */ + volatile bool restart_dev; /* Restart the device thread when it ends */ bool running_cam; /* thread is running*/ volatile int watchdog; diff --git a/src/picture.cpp b/src/picture.cpp index 05fc7f14..2d6235eb 100644 --- a/src/picture.cpp +++ b/src/picture.cpp @@ -314,7 +314,7 @@ void pic_save_norm(ctx_dev *cam, char *file, unsigned char *image, int ftype) ,_("Can't write picture to file %s - check access rights to target directory\n" "Thread is going to finish due to this fatal error"), file); cam->finish_dev = true; - cam->restart_cam = 0; + cam->restart_dev = false; return; } else { /* If target dir is temporarily unavailable we may survive. */ diff --git a/src/webu_post.cpp b/src/webu_post.cpp index 0f223d0c..54fdc56a 100644 --- a/src/webu_post.cpp +++ b/src/webu_post.cpp @@ -319,7 +319,7 @@ void webu_post_action_restart(ctx_webui *webui) MOTION_LOG(NTC, TYPE_STREAM, NO_ERRNO, _("Restarting all cameras")); indx = 0; while (webui->motapp->cam_list[indx]) { - webui->motapp->cam_list[indx]->restart_cam = true; + webui->motapp->cam_list[indx]->restart_dev = true; webui->motapp->cam_list[indx]->finish_dev = true; indx++; } @@ -327,7 +327,7 @@ void webu_post_action_restart(ctx_webui *webui) MOTION_LOG(NTC, TYPE_STREAM, NO_ERRNO , _("Restarting camera %d") , webui->motapp->cam_list[webui->threadnbr]->camera_id); - webui->motapp->cam_list[webui->threadnbr]->restart_cam = true; + webui->motapp->cam_list[webui->threadnbr]->restart_dev = true; webui->motapp->cam_list[webui->threadnbr]->finish_dev = true; } } @@ -355,7 +355,7 @@ void webu_post_action_stop(ctx_webui *webui) MOTION_LOG(NTC, TYPE_STREAM, NO_ERRNO , _("Stopping cam %d") , webui->motapp->cam_list[indx]->camera_id); - webui->motapp->cam_list[indx]->restart_cam = false; + webui->motapp->cam_list[indx]->restart_dev = false; webui->motapp->cam_list[indx]->event_stop = true; webui->motapp->cam_list[indx]->event_user = false; webui->motapp->cam_list[indx]->finish_dev = true; @@ -365,7 +365,7 @@ void webu_post_action_stop(ctx_webui *webui) MOTION_LOG(NTC, TYPE_STREAM, NO_ERRNO , _("Stopping cam %d") , webui->motapp->cam_list[webui->threadnbr]->camera_id); - webui->motapp->cam_list[webui->threadnbr]->restart_cam = false; + webui->motapp->cam_list[webui->threadnbr]->restart_dev = false; webui->motapp->cam_list[webui->threadnbr]->event_stop = true; webui->motapp->cam_list[webui->threadnbr]->event_user = false; webui->motapp->cam_list[webui->threadnbr]->finish_dev = true;