From 332647953275fdf1691cded8bbe5d4a8dfe7c675 Mon Sep 17 00:00:00 2001 From: "Steinar H. Gunderson" Date: Sun, 23 Dec 2018 01:11:54 +0100 Subject: [PATCH] If the Futatabi source URL is empty or /dev/null, don't bother trying to open it. --- futatabi/main.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/futatabi/main.cpp b/futatabi/main.cpp index edff307..3efefd5 100644 --- a/futatabi/main.cpp +++ b/futatabi/main.cpp @@ -183,7 +183,7 @@ FrameOnDisk write_frame(int stream_idx, int64_t pts, const uint8_t *data, size_t HTTPD *global_httpd; void load_existing_frames(); -int record_thread_func(); +void record_thread_func(); int main(int argc, char **argv) { @@ -451,8 +451,13 @@ void load_existing_frames() db.clean_unused_frame_files(frame_basenames); } -int record_thread_func() +void record_thread_func() { + if (global_flags.stream_source.empty() || global_flags.stream_source == "/dev/null") { + // Save the user from some repetitive messages. + return; + } + pthread_setname_np(pthread_self(), "ReceiveFrames"); int64_t pts_offset; @@ -512,5 +517,4 @@ int record_thread_func() start_pts = last_pts + TIMEBASE; } - return 0; } -- 2.39.2