We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d02ae90 commit 034934cCopy full SHA for 034934c
1 file changed
src/webu_stream.c
@@ -217,6 +217,13 @@ static void webu_stream_static_getimg(struct webui_ctx *webui)
217
memset(webui->resp_page, '\0', webui->resp_size);
218
219
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 */
227
if (webui->cnt->stream_norm.jpeg_data == NULL) {
228
pthread_mutex_unlock(&webui->cnt->mutex_stream);
229
return;
0 commit comments