]> git.sesse.net Git - nageru/commitdiff
If the Futatabi source URL is empty or /dev/null, don't bother trying to open it.
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Sun, 23 Dec 2018 00:11:54 +0000 (01:11 +0100)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Sun, 23 Dec 2018 00:11:54 +0000 (01:11 +0100)
futatabi/main.cpp

index edff307e38bd1a98584ef3c0a94d1e176f192538..3efefd5e94a1a279c751e970fa8b27be69485f16 100644 (file)
@@ -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;
 }