X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=futatabi%2Fmain.cpp;h=7c5f660ae5b97f928aed6b9c8daabe18a5744cc4;hb=c664eca0541eb9e813c0ead7fa596200eb51b45b;hp=c13e19694783e3e2b178ce2f28ef5b6e8fcb3702;hpb=4a9e97065dade428e373a83618bc973cd93cbe52;p=nageru diff --git a/futatabi/main.cpp b/futatabi/main.cpp index c13e196..7c5f660 100644 --- a/futatabi/main.cpp +++ b/futatabi/main.cpp @@ -145,7 +145,7 @@ FrameOnDisk write_frame(int stream_idx, int64_t pts, const uint8_t *data, size_t frames[stream_idx].push_back(frame); } - if (++file.frames_written_so_far >= 1000) { + if (++file.frames_written_so_far >= FRAMES_PER_FILE) { size_t size = ftell(file.fp); // Start a new file next time. @@ -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; }