X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=futatabi%2Fmain.cpp;h=5f262353eed6a55246286a557af0456ae2608528;hb=44b133d1372fb410fe0c8badcd4028965d95fbb8;hp=c4b31f55c231ed86b1d6ab61f5792e9ecfa81193;hpb=3d155e8781c19eabf2dcb879086db5fd8f8fe139;p=nageru diff --git a/futatabi/main.cpp b/futatabi/main.cpp index c4b31f5..5f26235 100644 --- a/futatabi/main.cpp +++ b/futatabi/main.cpp @@ -240,7 +240,10 @@ int main(int argc, char **argv) { QSurface *surface = create_surface(); QOpenGLContext *context = create_context(surface); - make_current(context, surface); + if (!make_current(context, surface)) { + printf("oops\n"); + exit(1); + } CHECK(movit::init_movit(MOVIT_SHADER_DIR, movit::MOVIT_DEBUG_OFF)); delete_context(context); // TODO: Delete the surface, too. @@ -431,6 +434,7 @@ void load_existing_frames() // Add a gap of one second from the old frames to the new ones. start_pts += TIMEBASE; } + current_pts = start_pts; for (int stream_idx = 0; stream_idx < MAX_STREAMS; ++stream_idx) { sort(frames[stream_idx].begin(), frames[stream_idx].end(), @@ -486,15 +490,7 @@ int record_thread_func() FrameOnDisk frame = write_frame(pkt.stream_index, pts, pkt.data, pkt.size, &db); post_to_main_thread([pkt, frame] { - if (pkt.stream_index == 0) { - global_mainwindow->ui->input1_display->setFrame(pkt.stream_index, frame); - } else if (pkt.stream_index == 1) { - global_mainwindow->ui->input2_display->setFrame(pkt.stream_index, frame); - } else if (pkt.stream_index == 2) { - global_mainwindow->ui->input3_display->setFrame(pkt.stream_index, frame); - } else if (pkt.stream_index == 3) { - global_mainwindow->ui->input4_display->setFrame(pkt.stream_index, frame); - } + global_mainwindow->display_frame(pkt.stream_index, frame); }); if (last_pts != -1 && global_flags.slow_down_input) {