]> git.sesse.net Git - nageru/commitdiff
Preload original JPEGs from disk.
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Fri, 26 Oct 2018 16:13:37 +0000 (18:13 +0200)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Fri, 26 Oct 2018 16:13:37 +0000 (18:13 +0200)
video_stream.cpp

index 39f633cc72f1232fc60f09cbaf09d4df406c0e80..c645ce30f33ca86bdbf649e0de293fdd35f1253d 100644 (file)
@@ -292,6 +292,10 @@ void VideoStream::schedule_original_frame(steady_clock::time_point local_pts, in
 {
        fprintf(stderr, "output_pts=%ld  original      input_pts=%ld\n", output_pts, input_pts);
 
+       // Preload the file from disk, so that the encoder thread does not get stalled.
+       // TODO: Consider sending it through the queue instead.
+       (void)read_file(filename_for_frame(stream_idx, input_pts));
+
        QueuedFrame qf;
        qf.local_pts = local_pts;
        qf.type = QueuedFrame::ORIGINAL;