We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 0bb7b95 commit 25484e1Copy full SHA for 25484e1
libraries/ESP32/examples/Camera/CameraWebServer/app_httpd.cpp
@@ -216,8 +216,12 @@ static esp_err_t stream_handler(httpd_req_t *req) {
216
size_t _jpg_buf_len = 0;
217
uint8_t *_jpg_buf = NULL;
218
char *part_buf[128];
219
+
220
static int64_t last_frame = 0;
-
221
+ if (!last_frame) {
222
+ last_frame = esp_timer_get_time();
223
+ }
224
225
res = httpd_resp_set_type(req, _STREAM_CONTENT_TYPE);
226
if (res != ESP_OK) {
227
return res;
@@ -232,11 +236,6 @@ static esp_err_t stream_handler(httpd_req_t *req) {
232
236
#endif
233
237
234
238
while (true) {
235
- if (!last_frame) {
- last_frame = esp_timer_get_time();
- }
239
240
fb = esp_camera_fb_get();
241
if (!fb) {
242
log_e("Camera capture failed");
0 commit comments