diff --git a/app_httpd.cpp b/app_httpd.cpp index 2026c4b..36654bb 100644 --- a/app_httpd.cpp +++ b/app_httpd.cpp @@ -251,9 +251,6 @@ static esp_err_t stream_handler(httpd_req_t *req){ _jpg_buf = fb->buf; } } - if(res == ESP_OK){ - res = httpd_resp_send_chunk(req, _STREAM_BOUNDARY, strlen(_STREAM_BOUNDARY)); - } if(res == ESP_OK){ size_t hlen = snprintf((char *)part_buf, 64, _STREAM_PART, _jpg_buf_len); res = httpd_resp_send_chunk(req, (const char *)part_buf, hlen); @@ -261,6 +258,9 @@ static esp_err_t stream_handler(httpd_req_t *req){ if(res == ESP_OK){ res = httpd_resp_send_chunk(req, (const char *)_jpg_buf, _jpg_buf_len); } + if(res == ESP_OK){ + res = httpd_resp_send_chunk(req, _STREAM_BOUNDARY, strlen(_STREAM_BOUNDARY)); + } if(fb){ esp_camera_fb_return(fb); fb = NULL;