]> git.sesse.net Git - nageru/blobdiff - futatabi/main.cpp
Get rid of an unneeded sleep and message on Futatabi exit.
[nageru] / futatabi / main.cpp
index 0ef51be546de44cc3e27ab78ec9cb657deee11ef..7c5f660ae5b97f928aed6b9c8daabe18a5744cc4 100644 (file)
@@ -255,6 +255,12 @@ int main(int argc, char **argv)
 
        load_existing_frames();
 
+       for (int stream_idx = 0; stream_idx < MAX_STREAMS; ++stream_idx) {
+               if (!frames[stream_idx].empty()) {
+                       assert(start_pts > frames[stream_idx].back().pts);
+               }
+       }
+
        MainWindow main_window;
        main_window.show();
 
@@ -529,8 +535,10 @@ void record_thread_func()
                        current_pts = pts;
                }
 
-               fprintf(stderr, "%s: Hit EOF. Waiting one second and trying again...\n", global_flags.stream_source.c_str());
-               sleep(1);
+               if (!should_quit.load()) {
+                       fprintf(stderr, "%s: Hit EOF. Waiting one second and trying again...\n", global_flags.stream_source.c_str());
+                       sleep(1);
+               }
 
                start_pts = last_pts + TIMEBASE;
        }