Skip to content

Commit 034934c

Browse files
committed
Add additional wait when processing static image requests
1 parent d02ae90 commit 034934c

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

src/webu_stream.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,13 @@ static void webu_stream_static_getimg(struct webui_ctx *webui)
217217
memset(webui->resp_page, '\0', webui->resp_size);
218218

219219
pthread_mutex_lock(&webui->cnt->mutex_stream);
220+
/* If no image, wait a second*/
221+
if (webui->cnt->stream_norm.jpeg_data == NULL) {
222+
pthread_mutex_unlock(&webui->cnt->mutex_stream);
223+
SLEEP(1,0);
224+
pthread_mutex_lock(&webui->cnt->mutex_stream);
225+
}
226+
/* If still no image, give up */
220227
if (webui->cnt->stream_norm.jpeg_data == NULL) {
221228
pthread_mutex_unlock(&webui->cnt->mutex_stream);
222229
return;

0 commit comments

Comments
 (0)