mirror of
https://github.com/espressif/esp32-camera.git
synced 2025-07-17 16:28:22 +08:00
Move _STREAM_BOUNDARY before _STREAM_PART
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.
This commit is contained in:
@ -212,6 +212,9 @@ esp_err_t jpg_stream_httpd_handler(httpd_req_t *req){
|
|||||||
_jpg_buf = fb->buf;
|
_jpg_buf = fb->buf;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if(res == ESP_OK){
|
||||||
|
res = httpd_resp_send_chunk(req, _STREAM_BOUNDARY, strlen(_STREAM_BOUNDARY));
|
||||||
|
}
|
||||||
if(res == ESP_OK){
|
if(res == ESP_OK){
|
||||||
size_t hlen = snprintf((char *)part_buf, 64, _STREAM_PART, _jpg_buf_len);
|
size_t hlen = snprintf((char *)part_buf, 64, _STREAM_PART, _jpg_buf_len);
|
||||||
|
|
||||||
@ -220,9 +223,6 @@ esp_err_t jpg_stream_httpd_handler(httpd_req_t *req){
|
|||||||
if(res == ESP_OK){
|
if(res == ESP_OK){
|
||||||
res = httpd_resp_send_chunk(req, (const char *)_jpg_buf, _jpg_buf_len);
|
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->format != PIXFORMAT_JPEG){
|
if(fb->format != PIXFORMAT_JPEG){
|
||||||
free(_jpg_buf);
|
free(_jpg_buf);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user