Close video.h264 socket

This commit is contained in:
Kamil Trzcinski 2022-04-04 23:40:59 +02:00
parent 9c761f7a45
commit 9e585f326a
2 changed files with 3 additions and 5 deletions

View File

@ -46,7 +46,9 @@ void http_video(http_worker_t *worker, FILE *stream)
} }
if (had_key_frame) { if (had_key_frame) {
fwrite(buf->start, buf->used, 1, stream); if (!fwrite(buf->start, buf->used, 1, stream)) {
goto error;
}
} else if (!requested_key_frame) { } else if (!requested_key_frame) {
device_force_key(buf->buf_list->device); device_force_key(buf->buf_list->device);
requested_key_frame = true; requested_key_frame = true;

4
main.c
View File

@ -103,10 +103,6 @@ bool check_streaming()
return http_jpeg_needs_buffer() || http_h264_needs_buffer(); return http_jpeg_needs_buffer() || http_h264_needs_buffer();
} }
void write_h264(buffer_t *buf)
{
}
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
if (open_camera() < 0) { if (open_camera() < 0) {