Skip to content

Commit

Permalink
Move _STREAM_BOUNDARY before _STREAM_PART (#3720)
Browse files Browse the repository at this point in the history
The boundary delimiter (_STREAM_BOUNDARY) needs to be send before the
body part (_STREAM_PART) too follow RFC2046. This caused ffplay/ffmpeg
to fail to open the MJPEG stream.
  • Loading branch information
abergmann authored Feb 14, 2020
1 parent 9b75c65 commit 13e0206
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions libraries/ESP32/examples/Camera/CameraWebServer/app_httpd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -403,16 +403,16 @@ static esp_err_t stream_handler(httpd_req_t *req){
}
}
}
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);
}
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;
Expand Down

0 comments on commit 13e0206

Please sign in to comment.