mirror of
https://github.com/Motion-Project/motion.git
synced 2026-03-04 22:36:18 -05:00
Cleaner shutdown for webu stream
This commit is contained in:
@@ -62,10 +62,12 @@ static void motion_signal_process(struct ctx_motapp *motapp)
|
||||
motapp->restart_all = true;
|
||||
/*FALLTHROUGH*/
|
||||
case MOTION_SIGNAL_SIGTERM: /* Quit application */
|
||||
|
||||
motapp->webcontrol_finish = true;
|
||||
|
||||
if (motapp->cam_list != NULL) {
|
||||
indx = 0;
|
||||
while (motapp->cam_list[indx]) {
|
||||
motapp->webcontrol_finish = true;
|
||||
motapp->cam_list[indx]->event_stop = true;
|
||||
motapp->cam_list[indx]->finish_cam = true;
|
||||
motapp->cam_list[indx]->restart_cam = false;
|
||||
|
||||
@@ -49,6 +49,10 @@ static void webu_stream_mjpeg_delay(struct webui_ctx *webui)
|
||||
struct timespec time_curr;
|
||||
long stream_delay;
|
||||
|
||||
if (webui->cam->motapp->webcontrol_finish) {
|
||||
return;
|
||||
}
|
||||
|
||||
clock_gettime(CLOCK_REALTIME, &time_curr);
|
||||
|
||||
/* The stream rate MUST be less than 1000000000 otherwise undefined behaviour
|
||||
@@ -82,6 +86,10 @@ static void webu_stream_mjpeg_getimg(struct webui_ctx *webui)
|
||||
int header_len;
|
||||
struct ctx_stream_data *local_stream;
|
||||
|
||||
if (webui->cam->motapp->webcontrol_finish) {
|
||||
return;
|
||||
}
|
||||
|
||||
memset(webui->resp_image, '\0', webui->resp_size);
|
||||
|
||||
/* Assign to a local pointer the stream we want */
|
||||
|
||||
Reference in New Issue
Block a user