From 20f4c24dae61f178d3c7da8f7349774ad5f98aa2 Mon Sep 17 00:00:00 2001 From: 15498th Date: Sun, 19 Dec 2021 02:12:10 +0300 Subject: [PATCH] Fix delay before first frame by sending first request boundary before entering the loop. --- app_httpd.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app_httpd.cpp b/app_httpd.cpp index 36654bb..665de3a 100644 --- a/app_httpd.cpp +++ b/app_httpd.cpp @@ -237,6 +237,10 @@ static esp_err_t stream_handler(httpd_req_t *req){ httpd_resp_set_hdr(req, "Access-Control-Allow-Origin", "*"); + if(res == ESP_OK){ + res = httpd_resp_send_chunk(req, _STREAM_BOUNDARY, strlen(_STREAM_BOUNDARY)); + } + while(true){ fb = esp_camera_fb_get(); if (!fb) {