]> git.sesse.net Git - nageru/blobdiff - nageru/kaeru.cpp
When exporting interpolated files, make sure they are seekable.
[nageru] / nageru / kaeru.cpp
index 390e3cc5f7754c092baa32131a79f595943b00d1..5cd6d297d6759dfc3d8b19d96bc33d534a9c5d7e 100644 (file)
@@ -91,7 +91,7 @@ void video_frame_callback(FFmpegCapture *video, X264Encoder *x264_encoder, Audio
                ts.ts.push_back(steady_clock::now());
 
                video_pts = av_rescale_q(video_pts, video_timebase, AVRational{ 1, TIMEBASE });
-               int64_t frame_duration = TIMEBASE * video_format.frame_rate_den / video_format.frame_rate_nom;
+               int64_t frame_duration = int64_t(TIMEBASE) * video_format.frame_rate_den / video_format.frame_rate_nom;
                x264_encoder->add_frame(video_pts, frame_duration, video->get_current_frame_ycbcr_format().luma_coefficients, video_frame.data + video_offset, ts);
                global_basic_stats->update(frame_num++, /*dropped_frames=*/0);
        }
@@ -225,6 +225,7 @@ int main(int argc, char *argv[])
 
        video.stop_dequeue_thread();
        // Stop the x264 encoder before killing the mux it's writing to.
+       global_x264_encoder = nullptr;
        x264_encoder.reset();
        return 0;
 }