From 9e585f326a7c4d62da12b1cf1d3abab4719985d9 Mon Sep 17 00:00:00 2001 From: Kamil Trzcinski Date: Mon, 4 Apr 2022 23:40:59 +0200 Subject: [PATCH] Close `video.h264` socket --- http_h264.c | 4 +++- main.c | 4 ---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/http_h264.c b/http_h264.c index b5e2e8a..6d186a6 100644 --- a/http_h264.c +++ b/http_h264.c @@ -46,7 +46,9 @@ void http_video(http_worker_t *worker, FILE *stream) } 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) { device_force_key(buf->buf_list->device); requested_key_frame = true; diff --git a/main.c b/main.c index e8ea02c..3386e27 100644 --- a/main.c +++ b/main.c @@ -103,10 +103,6 @@ bool check_streaming() return http_jpeg_needs_buffer() || http_h264_needs_buffer(); } -void write_h264(buffer_t *buf) -{ -} - int main(int argc, char *argv[]) { if (open_camera() < 0) {